cozy / cozy-contacts-v2

Contact books manager for Cozy
http://cozy.io
GNU Affero General Public License v3.0
20 stars 20 forks source link

[fix] clean dates on exports #295

Closed m4dz closed 7 years ago

m4dz commented 7 years ago

Related to #120

When we do an export, the bday field is exported as it. Unfortunately, this field is, at the moment, a free input one. The VCard bday field must be an ISO8601 or at least a YYYY-MM-DD format. Trying to do a magic with this field to try to detect a manually entered format is a no-way choice. Instead, we made the choice to test the date format and drop the field if it doesn't respect the expected one.

This PR makes this test and pop an error in console to inform about a malformed field.

To perfectly complete the #120 issue, we should:

gregorylegarec commented 7 years ago

Nice, thank you @m4dz ! <3