Glich - v0.3.0 Manual
gw - Gregorian ISO Week
Home Development v0.3.0 Manual Hics Library gw

Calendar Description - Scheme gw

The ISO Week calendar scheme is a system of numbering the weeks of the year and is based on the Gregorian calendar. A week is defined as Monday being day 1 through to Sunday day 7. The first week of the year is defined as the week containing the first Thursday of the Gregorian year. The ISO Week year thus has 52 or 53 weeks (364 or 371 days). The ISO Week year does not quite match the Gregorian year, with the year change occurring on the 29th, 30th or 31st of December, or the 1st, 2nd, 3rd or 4th of January - whichever day Monday falls.

Use Case

Details of the scheme were published in 1976 by the International Standards Organisation in their ISO 2015:1976 document. This was superseded in 2004 by the ISO 8601:2004 and later publications.

Definition

The ISO Week calendar is defined in terms of the Gregorian calendar.

The Record consists of three Fields named year, week and day.

Record
yearweekday

The week is as defined for the day field in the jwn Julian Week Number page. The first week of the year is defined as the week containing the first Thursday of the Gregorian year.

The Epoch is set at
gwyearweekday
111
=
gyearmonthday
111
=
jdnday
1721426
.

Formats

The formats supplied with this scheme.

Details of the the ISO 8601 standard format is shown in the format statement rules iso8601 section with examples to show how to extend the available formats.

Formats - Grammar gw
CodeRulePseudo:inPseudo:outExampleNote
ywdtextyear week dayyyyy ww Wday2023 6 WedD, S
ywd+textyear week dayyyyy ww Weekday2023 6 WednesdayS
isoiso8601ISO:8601 Week -YYYY-YYYY-Www-D2023-W06-3S
deftextyear week dayyyyy ww d2023 6 3H, S
uunit9y 9w 9d9y 9w 9d2023y 6w 3dH
Notes: D = Default, H = Hidden, S = Range shortcut supported. Example based on jdn# 2459984

Script

Script - Module hics:gregorian
grammar gw { name "Year Week Day"; fields year week day; lexicons w; alias field { wday week; } alias pseudo { d day; ww week; yyyy year; } alias unit { d day; w week; y year; } format ywd "{year}| {week}| {day:w:a}"; format "ywd+", "{year}| {week}| {day:w}"; format iso { rules iso8601 week minus; } preferred ywd; } scheme gw { name "Gregorian ISO Week"; base isoweek; grammar gw; }

The script uses the lexicon "w" definition from the jwn Julian Week Number scheme for the field day.

Home Development v0.3.0 Manual Hics Library gw

Managed by WebPageLayout Validated by HTML Validator (based on Tidy)

19th July 2023