This is a module for MagicMirror² that displays a countdown to a specified date or dates.
Clone this repository into your MagicMirror modules folder:
cd ~/MagicMirror/modules
git clone https://github.com/pharmot/MMM-SimpleCountdown.git
Add the module to the modules array in the config/config.js
file:
{
module: "MMM-SimpleCountdown",
position: "top_left", // Can be any of the available positions
config: {
// See below for configurable options
}
}
Option | Description | Default |
---|---|---|
updateInterval |
How often to update (in ms). | 30*60*1000 (30 minutes) |
size |
Change font size of countdown. Possible values are "small" , "medium" , and "large" |
"medium" |
showPastDates |
Set to true to show elapsed time since dates that have passed. |
false |
dates |
An array of dates to display. See Date Object. | N/A |
Key | Description | Example |
---|---|---|
title |
The title of the date. (Required) | "Election Day" |
date |
The date, as a string, formatted as: YYYY-MM-DD. (Required) | "2020-11-03" |
display |
The largest time unit to display. (Optional) Default value: "days" |
"weeks" "months" |
{
module: "MMM-SimpleCountdown",
position: "top_left",
size: "small",
config: {
dates: [
{
title: "Election Day",
date: "2020-11-03",
display: "months",
},
{
title: "Christmas",
date: "2020-12-25",
display: "weeks",
}
]
}
}
To update the module to the latest version, type the following commands:
cd ~/MagicMirror/modules/MMM-SimpleCountdown
git pull
If you haven't changed the module, this should work without any problems.
Type git status
to see your changes, if there are any, you can reset them with git reset --hard
. After that, git pull should be possible.
(with showPastDates
set to true
)