QOAL / localisetime

A web extension for localising times found in web pages
GNU General Public License v3.0
14 stars 0 forks source link

Lazily initialise DST/Summer time dependent short hand abbreviations #29

Open QOAL opened 9 months ago

QOAL commented 9 months ago

ET, CT, MT, PT are calculated on page load, even though they'll likely not be used.

To avoid impacting page load times, and doing useless work, we should wait until we detect that abbreviation being needed in a time before calculating it.

Easy to do, I just want to get this out of my head while I'm busy doing other stuff.

And we should be able to expand on this to include NZT (NZST, NZDT) and others. Probably have a object like: { abbr: "blah", summer: { start; dateInfo, abbr: "blah" }, winter: { start: dateInfo: abbr: "blah" } } The dateInfo might be tricky due to the rules of when it comes into force. Maybe those can be hardcoded functions, and we just list the func name in the obj & pass an optional arg.