我正在嘗試讓這段代碼為我工作:https://codepen.io/bbarry/pen/Eopdk我希望日歷從星期一開始。我已經將 .js 中的 days:[] 從 Sa-So 更改為 Mo-Su。但這僅更改標題。日期還是錯了,12月1日仍然是星期三,但今年應該是星期二。我很確定問題出在 .html 中這部分附近的某個地方:<thead> <tr class="c-weeks"> {{ for (i = 0; i < 7; i++) { }} <th class="c-name"> {{: days[i] }} </th> {{ } }} </tr></thead><tbody> {{ for (j = 0; j < 6 && (j < 1 || mode === 'month'); j++) { }} <tr> {{ for (i = 0; i < 7; i++) { }} {{ if (thedate > last) { dayclass = nextmonthcss; } else if (thedate >= first) { dayclass = thismonthcss; } }} <td class="calendar-day {{: dayclass }} {{: thedate.toDateCssClass() }} {{: date.toDateCssClass() === thedate.toDateCssClass() ? 'selected':'' }} {{: daycss[i] }} js-cal-option" data-date="{{: thedate.toISOString() }}"> <div class="date">{{: thedate.getDate() }}</div> {{ thedate.setDate(thedate.getDate() + 1);}} </td> {{ } }} </tr> {{ } }}</tbody>我已經嘗試更改循環(i = 0; i < 7; i++)但無法修復它。
“bootstrap 兼容日歷”不在周一開始
慕勒3428872
2023-12-14 15:41:11