bdarcus / csl-next

An experimental reimagining of CSL
Mozilla Public License 2.0
8 stars 0 forks source link

Date-time formatting todos #120

Open bdarcus opened 1 year ago

bdarcus commented 1 year ago
  1. [ ] hook up output locale (see #86)
  2. [ ] add "date-time" format(s)
  3. [ ] figure out and implement advanced EDTF dates (ranges and intervals, approximate, seasons, etc)
  4. [ ] #72

Not sure what we need on 2 and 3.

Date-time details

What formats do we need?

Here's what's possible with Intl.DateTimeFormat (playground):

console.log(new Intl.DateTimeFormat('de', {
    dateStyle: 'long',
    timeStyle: 'long',
    timeZone: 'Europe/Berlin'
}).format(date));
// Expected output: "20. Dezember 2020 um 04:23:16 MEZ"

@denismaier - if you have time and interest sometime soon, this may be something you have knowledge of?

Basically, I just need two or three starting date-time formats.

Seems the primary use case is accessing online resources.

If timezones are in some styles (I assume not all) included, how do they work; what zone?

Edit: quick googling says no timezones, so won't worry about for now.

Need to check if time-zone before formatting it

The edtf parser sets a time even if not in the input data.

So will need to account for that.