Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set minimum date in calendar? #107

Open
KuldeepAIP opened this issue May 20, 2020 · 2 comments
Open

How to set minimum date in calendar? #107

KuldeepAIP opened this issue May 20, 2020 · 2 comments

Comments

@KuldeepAIP
Copy link

In my app, there's 2 option to pick date. 1. From date and 2. To date.

both options are different and action is also different. Now i want something like this.

When user pick from date then i want to allow the user to select the date between From Date to Current Date.

I have review all available option but wasn't found any property that will set minimumDate in calendar.

Simulator Screen Shot - iPhone 11 Pro Max - 2020-05-20 at 17 53 14

In above screenshot you can see i have selected 06-05-2020 as From Date now i want the user to select To Date between 06-05-2020 to 20-05-2020.

Will you please guide me how can i do that?
Thanks

@sibahota059
Copy link

Hi, If you still need a solution for this, just use the following datasource method from the protocol.

func WWCalendarTimeSelectorShouldSelectDate(_ selector: WWCalendarTimeSelector, date: Date) -> Bool {
        if date <= maxDate{
            return true
        }else if date >= minDate{
            return true
        }
        return false
    }

@KuldeepAIP
Copy link
Author

@sibahota059 , Thanks for your help. let me try this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants