Day of the week of Christmas and New Year: Difference between revisions

→‎{{header|Wren}}: Now uses new Date.fromJulian method.
(→‎{{header|Wren}}: Rejigged to deal correctly with 1578.)
(→‎{{header|Wren}}: Now uses new Date.fromJulian method.)
Line 1,110:
This uses the same years as the Raku example.
 
The above module uses the Gregorian Proleptic calendar and therefore gives the wrong days of the week for 1578 as the earliest year for the adoption of the Gregorian calendar was 1582 when 10 days (from 5th until 14th October inclusive) were omitted. To get the correct days for 1578 (and agree with the Ruby entry) we therefore need to add 10 days to the Gregorian date which the ''Date.fromJulian'' method does automatically.
<syntaxhighlight lang="ecmascript">import "./date" for Date
 
Line 1,121:
}
System.print("\nActual days for 1578 (Julian calendar) were 10 days later:")
System.print(" New Year's day was on %(Date.newfromJulian(1578, 1, 1).addDays(10).weekDay), and Christmas day on %(Date.newfromJulian(1578, 12, 25).addDays(10).weekDay).")</syntaxhighlight>
 
{{out}}
9,476

edits