回答編集履歴
1
追記
answer
CHANGED
@@ -124,4 +124,37 @@
|
|
124
124
|
</script>
|
125
125
|
</body>
|
126
126
|
</html>
|
127
|
+
```
|
128
|
+
|
129
|
+
---
|
130
|
+
|
131
|
+
```javascript
|
132
|
+
|
133
|
+
while (first_dt_current < next_dt) {
|
134
|
+
|
135
|
+
// 日曜日なら行をたす
|
136
|
+
if (first_dt_current.getDay() === 0) {
|
137
|
+
var tbody_tr = $('<tr>').appendTo(tbody);
|
138
|
+
}
|
139
|
+
|
140
|
+
var td = $('<td>').text(first_dt_current.getDate()).appendTo(tbody_tr);
|
141
|
+
var today = new Date();
|
142
|
+
if (today.getFullYear() === first_dt_current.getFullYear() &&
|
143
|
+
today.getMonth() === first_dt_current.getMonth() &&
|
144
|
+
today.getDate() === first_dt_current.getDate()
|
145
|
+
) {
|
146
|
+
td.addClass('today');
|
147
|
+
}
|
148
|
+
|
149
|
+
if (first_dt_current.getDate() === 1) {
|
150
|
+
tbody_tr.addClass('has-first')
|
151
|
+
.data({
|
152
|
+
y: first_dt_current.getFullYear(),
|
153
|
+
m: first_dt_current.getMonth()
|
154
|
+
});
|
155
|
+
}
|
156
|
+
|
157
|
+
// 1日たす
|
158
|
+
first_dt_current.setDate(first_dt_current.getDate() + 1);
|
159
|
+
}
|
127
160
|
```
|