ISO 8601 parser/unparser / ISO8601DateFormatter.m

Author Commit Message Labels Comments Date
Peter Hosey
Fix week dates for certain weekdays. One of these subtractions gave a negative result for certain weekdays, and since all of these variables were unsigned, that change to the interpretation of the result threw a comparison out of whack. The fix is simply to make all of these signed integers.
Peter Hosey
Massive rewrite. The parser and unparser are now together in a single NSFormatter subclass, and are now based on NSCalendar and NSDateComponents instead of NSCalendarDate. The parser remains more or less unchanged. Two-thirds of the unparser is now based on NSDateFormatter, which handles that portion of ISO 8601 string-formatting more or less for free; the part not handled for free is week dates (because NSCalendar has a different idea of when the week starts), and that unparser also remains more or less unchanged.