Glich - v0.3.0 Manual
jwsn - Julian Week (Sunday) Number
Home Development v0.3.0 Manual Hics Library jwsn

Calendar Description - Scheme jwsn

The Julian Week (Sunday) Number is a count of weeks, a variation of the Julian Week Number scheme.

This scheme is based on the week starting on a Sunday, i.e. day 1 = Sunday.

Because this calendar scheme has limited historical value, its visibility is set at hidden.

Use Case

It is commonly used with the The Hebrew, Islamic calendars and variants. They use the optional field wsday.

The week field number has some value when considering week differences and ranges. It can also be used with modular arithmetic to create regular weekly intervals.

Definition

Week Names - Lexicon ws
NumberName
FullAbrev.
1SundaySun
2MondayMon
3TuesdayTue
4WednesdayWed
5ThursdayThur
6FridayFri
7SaturdaySat

The day start is not defined and will depend on context.

The Record consists of two Fields named week and day.

Record
weekday

The calendar is a repeating cycle of 7 days, starting with the first Sunday. The weeks are counted from the same era as the jdn scheme.

The Epoch is set at
jwsnweekday
11
=
jdnday
6
a Sunday.

Formats

The formats supplied with this scheme.

Formats - Grammar jwsn
CodeRulePseudo:inPseudo:outExampleNote
wdtextweek daywwwww d351518 7S
wdaytextweek daywwwww Wday351518 SatD, S
wday+textweek daywwwww Weekday351518 SaturdayS
deftextweek daywwwww d351518 7H, S
uunit9w 9d9w 9d351518w 7dH
Notes: D = Default, H = Hidden, S = Range shortcut supported. Example based on jdn# 2460631

Script

Script - Module hics:week
lexicon ws { name "Weekday names Sunday start"; fieldname wsday; lang en; pseudo Weekday, Wday; tokens { 1, "Sunday", "Sun"; 2, "Monday", "Mon"; 3, "Tuesday", "Tue"; 4, "Wednesday", "Wed"; 5, "Thursday", "Thur"; 6, "Friday", "Fri"; 7, "Saturday", "Sat"; } } grammar jwsn { name "Julian Week Number (Sunday)"; fields week day; lexicons ws; alias lexicon { wsday day; } alias pseudo { wwwww week; d day; } alias unit { d day; w week; } format wd "{week}| {day}"; format wday "{week}| {day:ws:a}"; format "wday+", "{week}| {day:ws}"; preferred wday; } scheme jwsn { name "Julian Week (Sunday) Number"; base jwn sunday; grammar jwsn; visible no; }

The script has no dependencies.

Home Development v0.3.0 Manual Hics Library jwsn

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

19th July 2023