Skip to content
This repository has been archived by the owner on Jan 30, 2025. It is now read-only.

Commit

Permalink
small bugfix for date difference function
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhohk authored Nov 17, 2023
1 parent c460bd5 commit fa10157
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function init() {
let monthDiff = (tday.getMonth()+1) - (date.getMonth()+1);
let dayDiff = tday.getDate() - date.getDate();
if (dayDiff < 0) {
dayDiff += daysInMonth(tday.getFullYear(), tday.getMonth()+1);
dayDiff += daysInMonth(tday.getFullYear(), (tday.getMonth()+1)-1);
monthDiff--;
}
if (monthDiff < 0) {
Expand Down Expand Up @@ -335,4 +335,4 @@ function init() {

}

$(document).ready(init);
$(document).ready(init);

0 comments on commit fa10157

Please sign in to comment.