Skip to content

Commit

Permalink
feat: 今年の経過日数計算の修正 (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
book000 authored Jan 3, 2024
1 parent 2f7ea0a commit 4c4c55f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/jobs/everyday.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,11 @@ export class EveryDayJob extends BaseDiscordJob {
// 年間通算日数
const yearStart = new Date(today.getFullYear(), 0, 1)
const yearEnd = new Date(today.getFullYear(), 11, 31)
// 今年の経過日数
const yearPassed = Math.floor(
(today.getTime() - yearStart.getTime()) / (1000 * 60 * 60 * 24)
)
// 今年の経過日数 (当日を含むため、+1)
const yearPassed =
Math.floor(
(today.getTime() - yearStart.getTime()) / (1000 * 60 * 60 * 24)
) + 1
// 年日数
const yearTotal = Math.floor(
(yearEnd.getTime() - yearStart.getTime()) / (1000 * 60 * 60 * 24)
Expand Down

0 comments on commit 4c4c55f

Please sign in to comment.