-
Notifications
You must be signed in to change notification settings - Fork 92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unusual REV value format not detected as Revision #73
Comments
It seems that there are many ways to express date and time, see https://forums.bitfire.at/post/7504 I guess you will have to import a whole library or something like that to understand all these crazy formats … but a good start would be to parse the format with the milliseconds, too. |
Note: I can't seem to find a freely available copy of ISO.8601.2004 online. I found something that looks like it, but not 100% sure it's exactly the same. Section 4.3.2, which the vCard TIMESTAMP data type adheres to, doesn't say anything about decimal fractions, so my opinion is that REV doesn't have to support it. But what vCard producers choose to do in the wild is another thing, so it might be worth supporting if a lot of producers decide to break with the spec. As you alluded to in your forum post, it appears there are other ways of representing a timestamp, which ez-vcard does not account for (see below). So yeah, that's a thing.
The Appendix B.2.3 you mention contains examples for reduced accuracy date formats, which are not applicable to the TIMESTAMP data type. |
In my tests, there are other time formats which don't work. Currently, Nextcloud Contacts uses the
and tests fail for
|
* All date formats are now parsed using a single regular expression. This significantly improves performance. * Added support for parsing dates that lack the minute component of the UTC offset. * Added support for parsing dates that lack UTC offsets. These dates are parsed under the local computer's timezone. #73
Added support for the above date formats that failed in 9a6977e. Timestamps without UTC offsets will be assumed to be in the local computer's timezone. |
Thank you very much! |
Thanks! If I read the code properly, in the end timestamps with milliseconds do not seem to be supported. Let's hope no client uses them (nextcloud/contacts currently is using them) nextcloud/contacts#65 |
Ok, I will add that. Can you remind me what that timestamp format looks like? |
20161227T155712.034Z I would express it like this:
|
Will the milliseconds always be 3 digits long? |
No, 1-6 digits can be expected |
Can you elaborate? Thanks. :) |
http://stackoverflow.com/questions/25842840/representing-fraction-of-second-with-iso-86012004 The ISO does not specify the number of digits, however I haven't seen more than six ever. |
Added in 27f4404. If it's greater than 3 digits, then it is rounded to the nearest millisecond. |
Thanks! |
Hello,
The following
REV
line (part of a VCard 4) seems not to be parsed asRevision
by ez-vcard:However, ISO.8601.2004 (which is referenced by the VCard4
REV
/TIMESTAMP
definition)YY-MM-DDThh:mm:ssZ
,I don't know whether this really applies to
REV
values, but I think the above value is allowed and should be parsed by correctly.Further reference: https://forums.bitfire.at/topic/1259/davdroid-1-3-4-1-ose-nextcloud-11-0-beta-carddav-sync-error/
The text was updated successfully, but these errors were encountered: