hare

[hare] The Hare programming language
git clone https://git.torresjrjr.com/hare.git
Log | Files | Refs | README | LICENSE

commit 10942dfa475a866ba79e7232018e3898cc0b6d17
parent afdd8b8470628da4c190b4ec0c5f74f3f4f3a6a0
Author: Byron Torres <b@torresjrjr.com>
Date:   Sun, 31 Jul 2022 17:51:35 +0100

time::chrono: give names to all timezones

Though [[timezone]].name is is generally used as the filepath where
their corresponding TZif file exists in /usr/share/zoneinfo, it is also
a general identifier.

"TAI", "GPS", "TT", and "MTC" aren't commonly used timezones -- they
don't have corresponding TZif files -- but they are standardized. It
seems sensible to be able to identify them, and use %L with them.

Therefore, the assumption that .name is a filepath should no longer hold
true universally. Perhaps we should introduce two separate fields for
these use cases.

Diffstat:
Mtime/chrono/timezone.ha | 8++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/time/chrono/timezone.ha b/time/chrono/timezone.ha @@ -286,7 +286,7 @@ const TZ_UTC: timezone = timezone { export const TAI: locality = &TZ_TAI; const TZ_TAI: timezone = timezone { - name = "", + name = "TAI", timescale = &tai, daylength = EARTH_DAY, zones = [ @@ -305,7 +305,7 @@ const TZ_TAI: timezone = timezone { export const GPS: locality = &TZ_GPS; const TZ_GPS: timezone = timezone { - name = "", + name = "GPS", timescale = &gps, daylength = EARTH_DAY, zones = [ @@ -324,7 +324,7 @@ const TZ_GPS: timezone = timezone { export const TT: locality = &TZ_TT; const TZ_TT: timezone = timezone { - name = "", + name = "TT", timescale = &tt, daylength = EARTH_DAY, zones = [ @@ -343,7 +343,7 @@ const TZ_TT: timezone = timezone { export const MTC: locality = &TZ_MTC; const TZ_MTC: timezone = timezone { - name = "", + name = "MTC", timescale = &mtc, daylength = MARS_SOL_MARTIAN, zones = [