iphone - NSCalendar dateFromComponents returns wrong value when using weeks -


so try weeks date range.

when current date components (only year , date) these values:

enter image description here

i noticed there "obsolescent" written near week. did try searching apple docs found nothing this.

then try nsdate current calendar (or gregorian calendar, same value) value is:

enter image description here

so weeks got ignored. added few months , 1 week components , had such components:

enter image description here

then tried date out of this, got:

enter image description here

now week components getting ignored here. why so? deprecated? or bug?

so found solution finally.

it appears sorts out (starts working) if set weekday:

[startdate setweekday:1]; 

then date week returned correctly.

do not know if still bug when week components ignored without setting weekday.


Comments

Popular posts from this blog

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

delphi - Dynamic file type icon -