Releases: Louis-Aime/calendrical-javascript
Persian calendar
Week computations were revisited, side effects with unfamiliar week structures (epagomenal days) are avoided.
Computations for the available calendars have been made more consistent by less direct call to Chronos primitives.
An algorithmic version of the Persian calendar, the same as used by Unicode, is implemented here. It used a 33 years cycle.
package.json in line with version tag
Fix Week computations, add Persian calendar
Week computations were revisited, side effects with unfamiliar week structures (epagomenal days) are avoided.
Computations for the available calendars have been made more consistent by less direct call to Chronos primitives.
An algorithmic version of the Persian calendar, the same as used by Unicode, is implemented here. It used a 33 years cycle.
Revisit calendar names
No change in the basic tools: time-units, fetchdom, chronos, extdate, extdatetimeformat
Changes in calendars.js, pldr, and as a consequence in calendrical-demo.*
Former GregorianCalendar class becomes ProlepticGregorianCalendar. This is the ISO 8601 recommended calendar.
Former WesternCalendar class becomes GregorianCalendar.
Era codes are changed to lowercase.
The (non-proleptic) Gregorian calendar is considered as the Julian calendar that switches to the Gregorian one at some customisable date.
Manage hour12 option consistently
The resolvedOptions()
method does not return the hour12
option anymore. This way, the resolved options of an existing ExtDateTimeFormat object shall yield the same result when passed to a new ExtDateTimeFormat object.
Detect eras for chinese and dangi calendars
For chinese and dangi calendars, detect whether era is the same as today's.
On current CLDR and ICU implementations in JS, the era
field of chinese and dangi calendars may only be displayed if year
is not asked. Here when eraDisplay
is "auto"
, the era is displayed only if it is different from today's.
Eras for Gregorian, handle intercalary months, select calendar by name.
New functions:
- select a calendar by name in PLDR, in order to substitute field names to names from CLDR;
- "gregory" calendar of PLDR has 3 eras: Before Christus, Julian (Ancient Style), Gregorian (New Style).
- management of intercalary months in PLDR, in the same way as in CLDR (hebrew)
- mark for intercalary months (chinese and dangi); the mark is specified in PLDR, it may differ by locale.`
- PLDR updated:
3 eras for calendars named gregory.
JSDoc comments
JSDoc comments inserted, JSDoc documentation generated. No change in code.
Full Changelog: V5.6.1...V5.7.0
Always use numbering system from locale
If a date field is numeric, always use the numbering system from the locale, even if the field is to be displayed "as is".
Static object are methods only
Certain navigators do not accept static objects that are not methods.
Moreover, readme file is updated.
Enhance conditional display of era
- Even if eraDisplay is set to "always", if the custom calendar has no era, no era shall be prepared and all era parts shall be deleted.
- In case an era part is prepared when no era should be displayed, not only the era part is deleted, but also the neighbouring literal: just before in general, or just after if era is first part.