• 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: NSDateComponents question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDateComponents question


  • Subject: Re: NSDateComponents question
  • From: mmalc crawford <email@hidden>
  • Date: Tue, 01 Jul 2008 09:26:21 -0700

Hi Chris,

On Jul 1, 2008, at 9:10 AM, Christopher Kane wrote:

The more subtle and serious issue is that Sunday in the current week might be in the previous Month (so, Day < Weekday), or even previous Year, so setting the Day to a negative value and keeping the Month and Year the same will have ... "who knows what effect".

My apologies; I did do some testing and found that the resultant date was always correct.
Could you elaborate on what circumstances this might not be correct?


A more robust approach would be to just get the weekday value:

Ironically that's effectively what I first suggested (with the addendum of the normalisation).

mmalc

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSDateComponents question
      • From: Chris Kane <email@hidden>
References: 
 >Re: NSDateComponents question (From: Jason Wiggins <email@hidden>)
 >Re: NSDateComponents question (From: mmalc crawford <email@hidden>)
 >Re: NSDateComponents question (From: Christopher Kane <email@hidden>)

  • Prev by Date: Re: Implementing NSOutlineView autosaveExpandedItems with CoreData
  • Next by Date: Re: mutableArrayForKeyValue Question (ignore other email)
  • Previous by thread: Re: NSDateComponents question
  • Next by thread: Re: NSDateComponents question
  • Index(es):
    • Date
    • Thread