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

Set custom date #251

Closed
monsterfi opened this issue Mar 16, 2016 · 10 comments
Closed

Set custom date #251

monsterfi opened this issue Mar 16, 2016 · 10 comments

Comments

@monsterfi
Copy link

Please I'd like to know if is now possibile to set a custom month/date in initialization phase of CVCalendar.
Thank you

@emjoseph
Copy link

Yeah I second that. It's important for when a user has already selected a date but is returning back to the calendar view to change it

@emjoseph
Copy link

Actually I believe I found the way to do it:
self.calendarView.toggleViewWithDate(date)

@monsterfi
Copy link
Author

I tried in that way too but I supposed that was the same as a click on a custom date.
Am I making a mistake?
My issue is a little bit different: suppose you'd like to set your initial view (before any click) on a chosen month. Now it's march and I want a calendar view directly on July on app launching, how could we have it?

@emjoseph
Copy link

I haven't tried the situation you're describing personally, but I think the line above should work in your case if its called in the "viewDidLoad" or "viewWillAppear" methods of the view controller you want to launch the app with.

In my case I call the function with the date I want to set the calendar too in the viewWillAppear method and it opens the calendar directly on the date I specified

@pavelhiq
Copy link

Hmm sounds strange - Im trying to call toggleViewWithDate(date) in viewDidLoad() but the calendar view does not react on it! Selection remains empty unless you tap on some date...

@zuaaef
Copy link

zuaaef commented Mar 26, 2016

Found a solution?

@pavelhiq
Copy link

not really.. seems it does not work at all unless shouldAutoSelectDayOnMonthChange is set to true,
so a number of strange assumptions about user interaction still holds in this library

@seenickcode
Copy link

seenickcode commented Jul 2, 2016

I can confirm this is quite strange behavior: I don't see any other way to render a calendar with a previous month. It appears that if one wants to load a calendar with a month in the past, one must call toggleViewWithDate() yet this does not work without setting shouldAutoSelectDayOnMonthChange() to return true.

@rlaferla
Copy link

+1

@elsesiy
Copy link
Member

elsesiy commented Nov 28, 2016

Should be fixed in #387

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

7 participants