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 | ||
---|---|---|
year | week | day |
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.
gw | year | week | day |
---|---|---|---|
1 | 1 | 1 |
g | year | month | day |
---|---|---|---|
1 | 1 | 1 |
jdn | day |
---|---|
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 | |||||
---|---|---|---|---|---|
Code | Rule | Pseudo:in | Pseudo:out | Example | Note |
ywd | text | year week day | yyyy ww Wday | 2023 6 Wed | D, S |
ywd+ | text | year week day | yyyy ww Weekday | 2023 6 Wednesday | S |
iso | iso8601 | ISO:8601 Week -YYYY | -YYYY-Www-D | 2023-W06-3 | S |
def | text | year week day | yyyy ww d | 2023 6 3 | H, S |
u | unit | 9y 9w 9d | 9y 9w 9d | 2023y 6w 3d | H |
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.