• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: First day of the week? Which one?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: First day of the week? Which one?


  • Subject: Re: First day of the week? Which one?
  • From: Wade Tregaskis <email@hidden>
  • Date: Sat, 29 Apr 2006 17:24:54 +1000

No, don't, because this returns 1 on my system (Monday), which is wrong.

Actually, just about everything in NSCalendar, including weekday enumerations, starts with the number 1 rather than 0.

The documentation for NSCalendar does not actually say what the return value means. I'm going from NSCalendarDate, which says:


"To retrieve conventional elements of an NSCalendarDate object, use the ...Of... methods. For example, dayOfWeek returns a number that indicates the day of the week (0 is Sunday). The monthOfYear method returns a number from 1 through 12 that indicates the month."

I figure dayOfWeek and firstWeekday should return the same types. So, 0 is Sunday, 1 is Monday. Whether 7 is valid and what it means, I don't know... I presume setFirstWeekday: would do a %7 on the input anyway, so the result is the same, either way..

Wade Tregaskis

    ICQ: 40056898
    AIM, Yahoo & Skype: wadetregaskis
    MSN: email@hidden
    iChat & email: email@hidden
    Jabber: email@hidden
    Google Talk: email@hidden

    http://homepage.mac.com/wadetregaskis/

-- Sed quis custodiet ipsos custodes?


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: First day of the week? Which one?
      • From: Nick Zitzmann <email@hidden>
References: 
 >First day of the week? Which one? (From: Stephane <email@hidden>)
 >Re: First day of the week? Which one? (From: Ryan Britton <email@hidden>)
 >Re: First day of the week? Which one? (From: Stephane Sudre <email@hidden>)
 >Re: First day of the week? Which one? (From: email@hidden)
 >Re: First day of the week? Which one? (From: Horst Hoesel <email@hidden>)
 >Re: First day of the week? Which one? (From: Wade Tregaskis <email@hidden>)
 >Re: First day of the week? Which one? (From: Deborah Goldsmith <email@hidden>)
 >Re: First day of the week? Which one? (From: Wade Tregaskis <email@hidden>)
 >Re: First day of the week? Which one? (From: Nick Zitzmann <email@hidden>)

  • Prev by Date: Re: First day of the week? Which one?
  • Next by Date: Should I prefix my private instance variables?
  • Previous by thread: Re: First day of the week? Which one?
  • Next by thread: Re: First day of the week? Which one?
  • Index(es):
    • Date
    • Thread