boazarad / MMM-CountDown

Magic Mirror Module to count down to a specific date
MIT License
36 stars 24 forks source link

Countdown Timer Displaying -18275 Days for March 9th 2020 #15

Open JCleary682 opened 4 years ago

JCleary682 commented 4 years ago

Hi

Unsure if this is a result of an incorrect config by myself, however the module is displaying -18275 Days for the 9th March 2020. Please see my config below

{ module: 'MMM-CountDown', position: "bottom_left", config: { // See configuration options event: "Dissertation Due", date: 2020-03-09, showHours: false, showMinutes: false, showSeconds: false, } },

Thanks James

icecoldsnake commented 4 years ago

It took awhile to get through this, and I'm a noob with under 10 hours in js, but I had to make a few changes to the MMM-CountDown.js file in the module's folder.

At the top of the file, change defaults: { event: "New Millenium:", date: "3000-01-01",

to (insert your event date in place of YYYY-MM-DD): defaults: { event: "New Millenium:", date: "YYYY-MM-DD",

next go down to lines 35-37 and update them to say var today = new Date().getTime(); var target = new Date(this.config.date); var timeDiff = target - today;