neige d'aoust

knowledge, art, and other stuff

User Tools

Site Tools


cardcal

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
cardcal [2025/11/11 22:40] Yukicardcal [2025/11/11 23:24] (current) Yuki
Line 52: Line 52:
 for(var month = 0; month < 12; month++) for(var month = 0; month < 12; month++)
 { {
-  var time = moment.utc(year+"-"+(month+1));+  var time = moment.utc(year+"-"+(month+1).toString().padStart(2,'0'));
   var name = time.format("MMMM");   var name = time.format("MMMM");
   var $table = jQuery(`<table class="inline">   var $table = jQuery(`<table class="inline">
Line 63: Line 63:
   var last = time.add(1,'months').subtract(1,'days').isoWeek()   var last = time.add(1,'months').subtract(1,'days').isoWeek()
   if(last < first)   if(last < first)
-    if(month == 0) first -= time.isoWeeksInYear(); +    if(month == 0) first -= moment.utc().isoWeekYear(year-1).isoWeeksInYear(); 
-    else if(month == 11) last += time.isoWeeksInYear();+    else if(month == 11) last += moment.utc().isoWeekYear(year).isoWeeksInYear();
   for(var week = first; week <= last; week++)   for(var week = first; week <= last; week++)
   {   {
Line 70: Line 70:
     var suit = weeks.findLastIndex(a=>a<=week);     var suit = weeks.findLastIndex(a=>a<=week);
     var days = Array(7).fill(0).map((a,i)=>{     var days = Array(7).fill(0).map((a,i)=>{
-      var m = moment.utc(year).isoWeek(week).day(i+2);+      var m = moment.utc().isoWeekYear(year).isoWeek(week).day(i+1);
       return m.month()==month?m.date():'';       return m.month()==month?m.date():'';
     })     })
cardcal.1762918820.txt.gz · Last modified: by Yuki