shoheiyokoyama / Koyomi

Simple customizable calendar component in Swift :calendar:
MIT License
749 stars 104 forks source link

First day of week #15

Closed SentoCrespo closed 7 years ago

SentoCrespo commented 7 years ago

Any way of setting another day to be the first of the week?

Thanks.

shoheiyokoyama commented 7 years ago

@vCrespoP Hi. Are you managing a date by array? In that case, you should change order of it.

For example, Koyomi manage date in DateModel, and get first day of month in indexAtBeginning.

EvilClay commented 7 years ago

The question here is that the first column in your calendar is Sunday. But for some regions, weeks begin on Monday, so the fist column should be Monday for some states.

EvilClay commented 7 years ago

https://developer.apple.com/reference/foundation/nscalendar/1408310-firstweekday

EvilClay commented 7 years ago

..so can you expose the "fileprivate lazy var model: DateModel = .init()" so we can access the model.calendar .. or make a method to allow to set a custom calnder into the model?

shoheiyokoyama commented 7 years ago

I support holidayColor for international calendar. you want to change first week, set week. Please wait until the next version.

// first of week is monday
koyomi.week = ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN", ]
lkuraer commented 6 years ago

Hi, great library. But I can't change first day of week to Monday, it's still Sunday. How can I do that? Is there any method?