This a module for the MagicMirror.
This module converts an interval into human readable units.
I just had a baby, and I wanted a geeky way to keep track of his exact age, so...
You can also use it to track any other past (or future) events!
Underneath, it's just a simple wrapper around HumanizeDuration.js
git clone https://github.com/ryck/MMM-Humanize-Duration.git && cd MMM-Humanize-Duration && npm install && cd ..
The entry in config.js
can include the following options:
Option | Description |
---|---|
date |
A date to track. Type: string |
options |
HumanizeDuration.js options. Type: object Default: { round: true, units: ["y", "mo", "w", "d"], largest: 3, language: config.language } |
updateInterval |
How often the arrival information is updated. Type: integer Default: 1 min |
initialLoadDelay |
The initial delay before loading. If you have multiple modules that use the same API key, you might want to delay one of the requests. (Milliseconds) Type: integer Possible values: 1000 - 5000 Default: 0 |
animationSpeed |
Speed of the update animation. (Milliseconds) Type: integer Possible values: 0 - 5000 Default: 500 (2 seconds) |
debug |
Show debug information. Possible values: true or false Default: false |
Here is an example of an entry in config.js
{
module: 'MMM-Humanize-Duration',
position: 'bottom_left',
header: 'David',
config: {
date: "2018-11-01 07:51",
options: {
units: ["y", "mo", "w", "d", "h", "m", "s"],
round: true,
largest: 5,
},
updateInterval: 1 * 1 * 1000,
animationSpeed: 250,
initialLoadDelay: 0,
debug: false
}
},
- HumanizeDuration.js (installed via
npm install
)
- Evan Hahn for the fastastic HumanizeDuration.js library
- Michael Teeuw for the MagicMirror2 framework that made this module possible.