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

First Day of Week #2

Open
flowhorn opened this issue Aug 14, 2018 · 4 comments
Open

First Day of Week #2

flowhorn opened this issue Aug 14, 2018 · 4 comments

Comments

@flowhorn
Copy link

Hello,
I really like your work, especially the calendar widget for flutter, as i use it in my app. And it is wonderful. But I would like to have the calendar not starting sunday and ending saturday, but from monday to sunday.
This would be fantastic!

@Sadoge
Copy link

Sadoge commented Sep 7, 2018

+1
It would be awesome if you could give us an option with which day of the week we would like to start. Thanks for the great work tho!

@JoeyMontero
Copy link

This is already a fantastic proyect, but having this option woudl be amazing.

@rravithejareddy
Copy link

Yes! For weekly calendar it should start from Monday, then only it will be useful. lot of other calendar providers doing that otherwise integrations will become tough.

@ghazi256
Copy link

ghazi256 commented Jan 16, 2020

Set firstWeekday = 1 in DateModel

and replace following code

func indexAtBeginning(in month: MonthType) -> Int?{ if let index = calendar.ordinality(of: .day, in: .weekOfMonth, for: atBeginning(of: month)) { let finalIndex = index - 2 if finalIndex < 0{ return 7 + finalIndex // + because final index is in negative } return finalIndex } return nil }

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

5 participants