Add date format support #4

Open
opened 2021-09-21 11:37:57 +02:00 by kazhnuz · 4 comments
Owner

It would be nice to support php date format (we won't need time formats, nor timezone). See what to use for ephemeride, J seems unused, so would be possible).

It would be nice to support [php date format](https://www.php.net/manual/fr/datetime.format.php) (we won't need time formats, nor timezone). See what to use for ephemeride, J seems unused, so would be possible).
Author
Owner

To do search/replace, two possibilities:

  • preg-replace can be used with a two-pass search (tokenize every matchable element, then parse each one found). Use the integrated PCRE package.
  • Use Parle/PECL, but it need an extension. Need PECL to be installed.
To do search/replace, two possibilities: - [preg-replace](https://www.php.net/manual/fr/function.preg-replace.php) can be used with a two-pass search (tokenize every matchable element, then parse each one found). Use the integrated PCRE package. - Use [Parle/PECL](https://www.php.net/manual/fr/parle.installation.php), but it need an extension. Need PECL to be installed.
Author
Owner
Character Description Exemple
Days -- --
d Day of the month, 2 digits with leading zeros 01-30
D A textual representation of a day, three letters Pri-Dec
j Day of the month without leading zeros 1-30
l (lowercase 'L') A full textual representation of the day of the "week" Primidi-Decadi
N ISO-8601-like numeric representation of the day of the "week" 1(primidi)-10(Decadi)
w Numeric representation of the day of the week 0(primidi)-9(decadi)
z The day of the year (starting from 0) 0 through 365
J The ephemeride Jour de la Revolution
Week -- --
W Revolutionar "week", which have 10 days 1-36
Month -- --
F A full textual representation of a month, such as January or March Vendemiaire to Jour Complémentaire
m Numeric representation of a month, with leading zeros 01 to 13 (Jours complémentaires)
M A short textual representation of a month, three letters Ven to Com
n Numeric representation of a month, without leading zeros 1 to 13
t Number of days in the given month 30
Year -- --
L Whether it's a leap year 1 if it is a leap year, 0 otherwise.
o Same as Y (no difference between Y in week) See Y
Y A full numeric representation of a year, 3 or 4 digits 224
y A two digit representation of a year 23
|Character|Description|Exemple| |---------|-----------|-------| |*Days*| -- | -- | |d|Day of the month, 2 digits with leading zeros|01-30| |D|A textual representation of a day, three letters|Pri-Dec| |j|Day of the month without leading zeros|1-30| |l (lowercase 'L')|A full textual representation of the day of the "week"|Primidi-Decadi| |N|ISO-8601-like numeric representation of the day of the "week"|1(primidi)-10(Decadi)| |w|Numeric representation of the day of the week|0(primidi)-9(decadi)| |z|The day of the year (starting from 0)|0 through 365| |J|The ephemeride|Jour de la Revolution| |*Week*| -- | -- | |W|Revolutionar "week", which have 10 days|1-36| |*Month*| -- | -- | |*F*|A full textual representation of a month, such as January or March|*Vendemiaire* to *Jour Complémentaire*| |*m*|Numeric representation of a month, with leading zeros|01 to 13 (Jours complémentaires)| |*M*|A short textual representation of a month, three letters|Ven to Com| |*n*|Numeric representation of a month, without leading zeros|1 to 13| |*t*|Number of days in the given month|30| |*Year*| -- | -- | |L|Whether it's a leap year|1 if it is a leap year, 0 otherwise.| |o|Same as Y (no difference between Y in week)|See Y| |Y|A full numeric representation of a year, 3 or 4 digits|224| |y|A two digit representation of a year|23|
Author
Owner

This API will need some thinking to handle the complementary Days.

This API will need some thinking to handle the complementary Days.
Author
Owner

For the complementaryDay, we could have a "formatWithJC" that would take two format, one for the common day, another for the JC

For the complementaryDay, we could have a "formatWithJC" that would take two format, one for the common day, another for the JC
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: kazhnuz/romme.php#4
No description provided.