Skip to content

Commit

Permalink
🐛 add 0 padding to single digit month
Browse files Browse the repository at this point in the history
  • Loading branch information
splendente committed May 6, 2024
1 parent 6472b80 commit d139491
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion components/calendar-heatmap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const pastYearDates = computed(() => {
const $year = $date.getFullYear(); // 年を取得
const $month = $date.getMonth() + 1; // 月を取得 (0始まりのため、+1する)
const $day = $date.getDate(); // 日を取得
const formattedDate = `${$year}-${$month}-${$day}`; // Nuxt Contentの日付情報と同じ形式に変換
const formattedDate = `${$year}-${String($month).padStart(2, "0")}-${$day}`; // Nuxt Contentの日付情報と同じ形式に変換
dates.push(formattedDate);
}
Expand Down

0 comments on commit d139491

Please sign in to comment.