how to customise FSCalendar

13,841

Solution 1

You can call the calendar selectDate with today's date in the button action. like below:

NSDate *today = [NSDate date];
[calendar setDate: today];

When you tap the button this will scroll to today with animation and select it.

I hope this helps.

Solution 2

If you want to show the month of today.

 calendar.currentPage = [NSDate date]; 

If you want to 'select' today and show the month of today

[calendar selectDate:[NSDate date]];

Solution 3

Button Action:    

- (void)backToToday {
// scroll to page date
self.currentPageDate = self.today;
// default selected date
self.selectedDate = self.today;

self.calendar.currentPage = self.currentPageDate;
[self.calendar selectDate:self.selectedDate scrollToDate:NO];
}

enter image description here

Share:
13,841
user5276912
Author by

user5276912

Updated on June 04, 2022

Comments

  • user5276912
    user5276912 almost 2 years

    I am using FSCalendar https://github.com/WenchaoIOS/FSCalendar I have a button in my VC and FSCalendar in UIView If I click on the button I need to show Current date(some thing like google calendar app) how can I do this ?