Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

RESTBody::getISO8601Formatter doesn't handle microseconds #20

Open
pagameba opened this issue Apr 16, 2012 · 0 comments
Open

RESTBody::getISO8601Formatter doesn't handle microseconds #20

pagameba opened this issue Apr 16, 2012 · 0 comments

Comments

@pagameba
Copy link

RESTBody::getISO8601Formatter() returns a formatter that doesn't handle microseconds, the spec however allows for up to 3 digit microsecond representation. Personally I don't care for the level of precision :) but when feeding documents with dates created by javascript clients, the default getISOString on a javascript Date object does include the additional precision. The quicky-and-dirty solution is to add .AAA to the formatter but then this breaks timestamps created without 3 digits of precision. I can't think of a good solution for this that doesn't create multiple formatters or modify the stored value (and hence cause spurious revisions to be generated).

I did check http://boredzo.org/iso8601unparser/ he has an NSFormatter subclass ISO8601DateFormatter that could be a drop-in replacement but I don't know how compatible it would be to use this with CouchCocoa.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant