1+ // ~~~~~ WEEK RENDERER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
12
23// Returns the ISO calendar week corresponding to the input date.
34function calcISOWeek ( inputDate ) {
@@ -24,8 +25,6 @@ function calcYearOfISOCalendarWeek(inputDate) {
2425 return purifiedDate . getFullYear ( ) ;
2526}
2627
27- // ~~~~~ WEEK RENDERER ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28-
2928// const formatter = new Intl.NumberFormat(undefined, {minimumIntegerDigits:2, useGrouping: false, numberingSystem: "tibt"});
3029// const formatter = new Intl.NumberFormat(undefined, {minimumIntegerDigits:1, useGrouping: false, numberingSystem: "hanidec"});
3130const formatter = new Intl . NumberFormat ( undefined , { minimumIntegerDigits : 2 , useGrouping : false } ) ;
@@ -41,10 +40,7 @@ const quarterFormatter = new Intl.NumberFormat(undefined, { minimumIntegerDigits
4140const yearFormatter = new Intl . DateTimeFormat ( undefined , { year : "numeric" } ) ;
4241console . log ( `[${ new Date ( "2025-12-29T11:11:11.111Z" ) . toLocaleDateString ( ) } ] Q ${ quarterFormatter . format ( calcQuarter ( d ) ) } /${ yearFormatter . format ( d ) } ` ) ;
4342
44-
45-
4643/**
47-
4844showdate("2024-10-06T19:40:55.221Z"); 2024-10-06 -> CW 40 2024
4945showdate("2023-01-01T19:40:55.221Z"); 2023-01-01 -> CW 52 2022
5046showdate("2025-12-28T11:11:11.111Z"); 2025-12-28 -> CW 52 2025
@@ -60,5 +56,4 @@ showdate("2027-01-01T11:11:11.111Z"); 2027-01-01 -> CW 53 2026
6056showdate("2027-01-02T11:11:11.111Z"); 2027-01-02 -> CW 53 2026
6157showdate("2027-01-03T11:11:11.111Z"); 2027-01-03 -> CW 53 2026
6258showdate("2027-01-04T11:11:11.111Z"); 2027-01-04 -> CW 01 2027
63-
6459*/
0 commit comments