Code Monkey home page Code Monkey logo

calendardaterangepickerviewcontroller's Introduction

CalendarDateRangePickerViewController

CI Status Version License Platform

Example

To run the example project, clone the repo, and run pod install from the Example directory first.

Here's what it looks like:

alt text

Usage

It's as simple as:

let dateRangePickerViewController = CalendarDateRangePickerViewController(collectionViewLayout: UICollectionViewFlowLayout())
dateRangePickerViewController.delegate = self
let navigationController = UINavigationController(rootViewController: dateRangePickerViewController)
self.navigationController?.present(navigationController, animated: true, completion: nil)

Just implement the delegate methods:

protocol CalendarDateRangePickerViewControllerDelegate {
    func didCancelPickingDateRange()
    func didPickDateRange(startDate: Date!, endDate: Date!)
}

You can also set additional options to override the defaults:

dateRangePickerViewController.minimumDate = Date()
dateRangePickerViewController.maximumDate = Calendar.current.date(byAdding: .year, value: 2, to: Date())
dateRangePickerViewController.selectedStartDate = Date()
dateRangePickerViewController.selectedEndDate = Calendar.current.date(byAdding: .day, value: 10, to: Date())
dateRangePickerViewController.selectedColor = UIColor.red
dateRangePickerViewController.titleText = "Select Date Range"

Installation

CalendarDateRangePickerViewController is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod 'CalendarDateRangePickerViewController'

Author

miraan, [email protected]

License

CalendarDateRangePickerViewController is available under the MIT license. See the LICENSE file for more info.

calendardaterangepickerviewcontroller's People

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  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  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

calendardaterangepickerviewcontroller's Issues

Horizontal scrolling

@thanks for such nice calender , Actually I face a issue when i do
let layout = UICollectionViewFlowLayout()
layout.scrollDirection = .horizontal
self.collectionView!.collectionViewLayout = layout

for your calender collectionView it changes the frontend for the user (row/column) please give some update on this , how to do horizontal scrolling in this calender , thank's .

White color when button is selected

hi,

I'm facing a strange issue.
when a tablewarebutton become available for usage ( ex. "Done" after selecting the date) it become white.
I can't find where this propriety is managed in source code.
could you help me ?

Select Single Date

Hello, many greetings for the awesome plugins but is that possible to select single date?

feature: add change locale

There is no way to specify the date locale now, if you are using internationalization and want to keep the date locale untouched there is no way to achieve it.
Specially if you has Arabic language in your App, the Calendar will be in "Hijri"

UI alignment issue in 4 inch screen device iPhone 5s iPhone SE

The sample project from GitHub working fine in iPhone 5s & other related device, but after configuring pods with our original project: UI gets miss placed (not equal with weekdays 7 part) also there is thick white color line still appears & navigation bar icons does not shown as attached screenshots

Screenshot 2019-07-08 at 4 30 31 PM

Show current date

When you open the calendar then show current date.

Ex:- Minimum date -1/1/2016, then it start from 1/1/2016 BUT i want to show my current date like today BUT minimum date is same as 1/1/2016 as it is.

How can i do that.

Thanks in advance.

Crash Issue

Hi i have integrated the pod as directed. Yet it gave me error in the File - "CalendarDateRangePickerViewController.swift" at line no. - 76 as - " Unexpectedly found nil while implicitly unwrapping an Optional value "

Here is the code crashing -

override public func numberOfSections(in collectionView: UICollectionView) -> Int {
let difference = Calendar.current.dateComponents([.month], from: minimumDate, to: maximumDate)
return difference.month! + 1
}

Disable Dates?

Hello,

Quick question, could I disable future dates? I see you have past days disabled.

How to change start date and end date?

Is there any option to set start date and end date? And can be start date is less than end date, Because I want to start with current date to the date of 2005.
Please help me to achieve it.

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.