Git Product home page Git Product logo

sscalendarcontrol's Introduction

SSCalendarControl

SSCalendarControl is small and highly customizable calendar control written in swift.

Swift Version Build Status License Platform PRs Welcome

Alt text

Features!

  • Customizable control
  • Flexible date range
  • Customizable week day
  • Selection delegates
  • Customizable month and days cells
  • CocoaPods

Requirements

  • iOS 10.0+
  • Xcode 9+

Installation

  • You can use CocoaPods to install SSCalendarControl by adding it to your Podfile:

     use_frameworks!
     pod 'SSCalendarControl'
    
  •  import UIKit
     import SSCalendarControl
    

Manually

  • Download and drop SSCalendarControl folder in your project.
  • Congratulations!

Usage example

  • In the storyboard add a UIView and change its class to SSCalendarView Alt text

Setup Calendar

calendarView.setUpCalendar(startDate: startDate, endDate: endDate, weekStartDay: .monday, shouldSelectPastDays: true, sholudAllowMultipleSelection: false)

Weekday Customization

calendarView.configuration.weekDayBorderColor = UIColor.black
calendarView.configuration.weekDayLabelBackgroundColor = UIColor.clear
calendarView.configuration.weekDayLabelTextColor = UIColor.black

Month Customization

calendarView.configuration.monthViewBackgroundColor = UIColor.white
calendarView.configuration.monthViewBottomLineColor = UIColor.darkGray
calendarView.configuration.monthLabelFont = UIFont.systemFont(ofSize: 20)
calendarView.configuration.monthLabelTextColor = UIColor.red

Days Customization

calendarView.configuration.previousDayTextColor = UIColor.black
calendarView.configuration.previousDayBorderColor = UIColor.clear
calendarView.configuration.upcomingDaysBorderColor = UIColor.clear
calendarView.configuration.upcomingDaysBorderColor = UIColor.clear
calendarView.configuration.upcomingDayTextColor = UIColor.brown
calendarView.configuration.selectedDayTextColor = UIColor.yellow
calendarView.configuration.currentDayBorderColor = UIColor.black
calendarView.configuration.currentDayTextColor = UIColor.white
calendarView.configuration.currentDayBackgroundColor = UIColor.red

Selection Delegates

calendarView.delegate = self

extension ViewController: SSCalendarDeleagte {

    func dateSelected(_ date: Date) {
        print("selected: \(date)")
    }

    func dateDeSelected(_ date: Date) {
        print("deSelected: \(date)")
    }
}

Contribute

  • We would love you for the contribution to SSCalendarControl, check the LICENSE file for more info.

Meta

  • Distributed under the MIT license. See LICENSE for more information.

sscalendarcontrol's People

Contributors

ketan-simform avatar simform-solutions avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

sscalendarcontrol's Issues

Need to show selected date in calendar.

Hi,
I need to show multiple dates selected in the calendar, viewDidAppear(). Any help?

Now I am using like this it's not working,

override func viewDidAppear(_ animated: Bool) {
let today = Date()
let tomorrows = Calendar.current.date(byAdding: .day, value: 2, to: today)!
dateSelected(tomorrows)
}

Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.