hilios / jQuery.countdown

The Final Countdown plugin for jQuery
http://hilios.github.io/jQuery.countdown/
MIT License
2.3k stars 720 forks source link

Year not accurate and monthsToYear missing #303

Open GRAFIX21 opened 6 years ago

GRAFIX21 commented 6 years ago

I'm just flying here over. Today I needed a small countdown-script for two long-term countdowns (with years, months, days, hours, minutes, seconds) and found this one. Thought I could be a happy guy, until I recognized some small bugs. The calculation for "monthsToYear" was missing and the one for the "year" was not right (always one to much).

I extended the letters with: x: "monthsToYear", ... (sure there is a better one letter)

and changed/extended the calculation to: year: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 30.4368 / 12), monthsToYear: Math.floor(this.totalSecsLeft / 60 / 60 / 24 / 30.4368) % 12,

Just an quick idea for the next release.