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

Month names #1

Open
lutc opened this issue May 12, 2017 · 1 comment
Open

Month names #1

lutc opened this issue May 12, 2017 · 1 comment

Comments

@lutc
Copy link

lutc commented May 12, 2017

Is it possible to show name of month between month sections? Like Section header

@TillMoss
Copy link

TillMoss commented May 8, 2024

1- Add:
public protocol YMCalendarDateDelegate: AnyObject{ func pageChanged(date: Date) }
inside YMCalendarView.
2- After that add:
public weak var delegateDate: YMCalendarDateDelegate?
inside YMCalendarView.
3- After add:
delegateDate?.pageChanged(date: dateAt(indexPath))
Inside
private func monthRowView(at indexPath: IndexPath) -> YMMonthWeekView
before return.
4- In your ViewDidLoad add:
calendarView.delegateDate = self
5- and add:
extension YourViewController: YMCalendarDateDelegate{ func pageChanged(date: Date) { let dateFormatter = DateFormatter() dateFormatter.dateFormat = "MMMM yyyy" self.labelMonthName.text = dateFormatter.string(from: date).capitalized } }

Enjoy

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