Kantoor. Contacts. Birthday
(Kantoor v1.0.0)
A contact's birthday (vCard BDAY, RFC 6350 section 6.2.5; RFC 2426 section
3.1.5 for vCard 3.0), with or without a year.
Clients write it in several forms and all are read:
19850412and1985-04-12(a date, basic and extended ISO 8601);--0412and--04-12(month and day, vCard 4 style, no year);- a date-time such as
19850412T000000Zor1985-04-12T23:30:00-04:00: the date as written is the birthday, the time and offset are ignored; 1604-04-12with the parameterX-APPLE-OMIT-YEAR=1604, which is how Apple's Contacts writes a birthday whose year is not known into a 3.0 card.
Writing follows the card's own version (line/2). BDAY values the page does
not change are kept as written by Kantoor.Contacts; this module only reads
and writes what the user edited.
Summary
Functions
The value for a date picker (YYYY-MM-DD); a leap year stands in when there is none.
The content line for the card version, 3.0 or 4.0: BDAY by default, or the
property name (ANNIVERSARY uses the same date forms).
Reads a BDAY value. params are the property's parameters (a list of
{name, [value]} as Dav.Card.VCard gives them, or a map). :error when the
text is not a date.
The birthday as shown, e.g. 12 Apr 1985, or 12 Apr without a year.
Types
@type t() :: %Kantoor.Contacts.Birthday{ day: 1..31, month: 1..12, year: integer() | nil }
Functions
The value for a date picker (YYYY-MM-DD); a leap year stands in when there is none.
The content line for the card version, 3.0 or 4.0: BDAY by default, or the
property name (ANNIVERSARY uses the same date forms).
Reads a BDAY value. params are the property's parameters (a list of
{name, [value]} as Dav.Card.VCard gives them, or a map). :error when the
text is not a date.
The birthday as shown, e.g. 12 Apr 1985, or 12 Apr without a year.