Vurig-Calendar icon indicating copy to clipboard operation
Vurig-Calendar copied to clipboard

How to start from sunday?

Open DKalachniuk opened this issue 11 years ago • 4 comments

I commented this line [weekdays moveObjectFromIndex:0 toIndex:6]; so it shows correct weekdays -from sunday to monday but it shows not correct days right now. Please advise

DKalachniuk avatar Jul 05 '13 14:07 DKalachniuk

I can't fully support this code right now. But you can use the NSDate categories to adjust the calendar types and therefor the dates. You may also want to look into the drawrect method of the calendar to adjust the names of the week.

tjeerdintveen avatar Jul 08 '13 09:07 tjeerdintveen

but i need to show correct dates with correct weekdays. I commented [weekdays moveObjectFromIndex:0 toIndex:6]; but it is not enough. Hope for your help in drawRect method

DKalachniuk avatar Jul 08 '13 11:07 DKalachniuk

OK. I found how to start from SUNDAY. need to change two rows :

  1. comment [weekdays moveObjectFromIndex:0 toIndex:6]; in drawRect method. Now it will start from sunday
  2. change firstWeekInMonth method in NSDate+convenience. Change [gregorian setFirstWeekday:2]; to [gregorian setFirstWeekday:1];

That's it

DKalachniuk avatar Jul 09 '13 06:07 DKalachniuk

Thanks, DKalachniuk. You saved my day!!! :)

xmram avatar Jan 27 '14 01:01 xmram