Closed rfc2822 closed 4 years ago
It looks I should be able to add support for this particular date format without breaking anything.
The fix would involve changing the date parsing regex from
(\\d{4})-?(\\d{2})-?(\\d{2})
to
(\\d{4})-?(\\d{1,2})-?(\\d{1,2})
However, if the hyphens are removed, this can create ambiguity (some vCard versions do not use hyphens in their dates).
For example:
2020-1-13
: We know this is Jan 13
2020113
: Is this Jan 13 or Nov 3?
Yes, I guess it would only be applicable to the format with hyphens. The supposed change of the regex sounds very good to me :)
Fixed in b8102eac839352398422b70b8d53643bd043d3d1.
Thanks! :)
The server vendor has already said that they will fix the format on their side, too, but I think it will increase compatibility nevertheless!
Ah, that's good to hear. Yes, this will make ez-vcard a bit more flexible!
Hi,
We recently found that a (quite common) CardDAV server serves vCards like this one:
(note the wrong date syntax without leading zeroes)
This is parsed as a
RawProperty
by ez-vcard, and not asBirthday
as one may expect. We will report this to the server vendor, of course.However, would it be possible to apply some kind of relaxed parsing so that month and day values without leading zero are detected and assigned to the original property (in this case,
Birthday
instead ofRawProperty
)?