Skip to content

MagicMirror 2 module to convert an interval into human readable units.

License

Notifications You must be signed in to change notification settings

ryck/MMM-Humanize-Duration

Repository files navigation

MMM-Humanize-Duration

This a module for the MagicMirror.

This module converts an interval into human readable units.

Motivation

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

Screenshot

Installation

git clone https://github.com/ryck/MMM-Humanize-Duration.git && cd MMM-Humanize-Duration && npm install && cd ..

Config

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
	}
},

Dependencies

Thanks To...

About

MagicMirror 2 module to convert an interval into human readable units.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published