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 23:14] Yukicardcal [2025/11/11 23:24] (current) Yuki
Line 57: Line 57:
  <thead>  <thead>
  <tr class="row0"><th class="col0 centeralign" colspan="9">${name}</th></tr>  <tr class="row0"><th class="col0 centeralign" colspan="9">${name}</th></tr>
- <tr class="row1"><th class="col0"></th><th class="col1 centeralign">Su</th><th class="col2 centeralign">Mo</th><th class="col3 centeralign">Tu</th><th class="col4 centeralign">We</th><th class="col5 centeralign">Th</th><th class="col6 centeralign">Fr</th><th class="col7 centeralign">Sa</th><th class="col8"></th></tr>+ <tr class="row1"><th class="col0"></th><th class="col1 centeralign">Mo</th><th class="col2 centeralign">Tu</th><th class="col3 centeralign">We</th><th class="col4 centeralign">Th</th><th class="col5 centeralign">Fr</th><th class="col6 centeralign">Sa</th><th class="col7 centeralign">Su</th><th class="col8"></th></tr>
  </thead>  </thead>
  <tbody></tbody></table>`)  <tbody></tbody></table>`)
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().isoWeekYear(year).isoWeek(week).day(i);+      var m = moment.utc().isoWeekYear(year).isoWeek(week).day(i+1);
       return m.month()==month?m.date():'';       return m.month()==month?m.date():'';
     })     })
cardcal.1762920878.txt.gz · Last modified: by Yuki