回答編集履歴
1
追記
test
CHANGED
@@ -251,3 +251,69 @@
|
|
251
251
|
</html>
|
252
252
|
|
253
253
|
```
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
---
|
258
|
+
|
259
|
+
|
260
|
+
|
261
|
+
```javascript
|
262
|
+
|
263
|
+
|
264
|
+
|
265
|
+
while (first_dt_current < next_dt) {
|
266
|
+
|
267
|
+
|
268
|
+
|
269
|
+
// 日曜日なら行をたす
|
270
|
+
|
271
|
+
if (first_dt_current.getDay() === 0) {
|
272
|
+
|
273
|
+
var tbody_tr = $('<tr>').appendTo(tbody);
|
274
|
+
|
275
|
+
}
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
var td = $('<td>').text(first_dt_current.getDate()).appendTo(tbody_tr);
|
280
|
+
|
281
|
+
var today = new Date();
|
282
|
+
|
283
|
+
if (today.getFullYear() === first_dt_current.getFullYear() &&
|
284
|
+
|
285
|
+
today.getMonth() === first_dt_current.getMonth() &&
|
286
|
+
|
287
|
+
today.getDate() === first_dt_current.getDate()
|
288
|
+
|
289
|
+
) {
|
290
|
+
|
291
|
+
td.addClass('today');
|
292
|
+
|
293
|
+
}
|
294
|
+
|
295
|
+
|
296
|
+
|
297
|
+
if (first_dt_current.getDate() === 1) {
|
298
|
+
|
299
|
+
tbody_tr.addClass('has-first')
|
300
|
+
|
301
|
+
.data({
|
302
|
+
|
303
|
+
y: first_dt_current.getFullYear(),
|
304
|
+
|
305
|
+
m: first_dt_current.getMonth()
|
306
|
+
|
307
|
+
});
|
308
|
+
|
309
|
+
}
|
310
|
+
|
311
|
+
|
312
|
+
|
313
|
+
// 1日たす
|
314
|
+
|
315
|
+
first_dt_current.setDate(first_dt_current.getDate() + 1);
|
316
|
+
|
317
|
+
}
|
318
|
+
|
319
|
+
```
|