Skip to content

Commit fc6c339

Browse files
committed
土曜日判定の変数を作成
1 parent f255417 commit fc6c339

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

02.calendar/cal.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,11 @@ function printCalendar(year, month) {
2323
for (let day = firstDay; day <= lastDay; day = day.plus({ days: 1 })) {
2424
const formattedDay = day.day.toString().padStart(2);
2525
const isLastDay = day.hasSame(lastDay, "day");
26+
const isSaturday = day.weekday === 6;
2627
if (isLastDay) {
2728
console.log(formattedDay);
2829
console.log();
29-
} else if (day.weekday === 6) {
30+
} else if (isSaturday) {
3031
console.log(formattedDay);
3132
} else {
3233
process.stdout.write(`${formattedDay} `);

0 commit comments

Comments
 (0)