boredzo / iso-8601-date-formatter

A Cocoa NSFormatter subclass to convert dates to and from ISO-8601-formatted strings. Supports calendar, week, and ordinal formats.
http://boredzo.org/iso8601dateformatter/
Other
600 stars 140 forks source link

dateComponentsFromString: methods make stuff up #29

Closed boredzo closed 8 years ago

boredzo commented 11 years ago

The dateComponentsFromString: methods fill in anything not specified by the string with the corresponding components from the current local date/time.

This is an artifact of the old, pre-NSDateComponents design. In the current design, it is broken behavior.

The components should not contain any information not directly sourced from the input string. Interpolation of missing components should happen in dateFromString:, if at all.