2016-04-01 14:16:39 +02:00
# Module: Clock
The `clock` module is one of the default modules of the MagicMirror.
This module displays the current date and time. The information will be updated realtime.
## Using the module
To use this module, add it to the modules array in the `config/config.js` file:
````javascript
modules: [
{
module: 'clock',
position: 'top_left', // This can be any of the regions.
config: {
// The config property is optional.
2016-04-03 19:52:13 +02:00
// See 'Configuration options' for more information.
2016-04-01 14:16:39 +02:00
}
}
]
````
## Configuration options
The following properties can be configured:
2016-04-01 14:19:50 +02:00
< table width = "100%" >
2016-04-01 14:16:39 +02:00
<!-- why, markdown... -->
< thead >
< tr >
< th > Option< / th >
2016-04-01 14:19:50 +02:00
< th width = "100%" > Description< / th >
2016-04-01 14:16:39 +02:00
< / tr >
< thead >
< tbody >
< tr >
< td > < code > timeFormat< / code > < / td >
2016-04-01 16:43:59 +02:00
< td > Use 12 or 24 hour format.< br >
2016-04-01 14:18:39 +02:00
< br > < b > Possible values:< / b > < code > 12< / code > or < code > 24< / code >
2016-04-01 16:43:59 +02:00
< br > < b > Default value:< / b > uses value of < i > config.timeFormat< / i >
2016-04-01 14:16:39 +02:00
< / td >
< / tr >
< tr >
< td > < code > displaySeconds< / code > < / td >
< td > Display seconds.< br >
2016-04-01 14:18:39 +02:00
< br > < b > Possible values:< / b > < code > true< / code > or < code > false< / code >
< br > < b > Default value:< / b > < code > true< / code >
2016-04-01 14:16:39 +02:00
< / td >
< / tr >
2016-04-18 20:01:53 -04:00
< tr >
< td > < code > showPeriod< / code > < / td >
2016-04-29 11:25:05 -04:00
< td > Show the period (am/pm) with 12 hour format.< br >
2016-04-18 20:01:53 -04:00
< br > < b > Possible values:< / b > < code > true< / code > or < code > false< / code >
< br > < b > Default value:< / b > < code > true< / code >
< / td >
< / tr >
< tr >
< td > < code > showPeriodUpper< / code > < / td >
2016-04-29 11:25:05 -04:00
< td > Show the period (AM/PM) with 12 hour format as uppercase.< br >
< br > < b > Possible values:< / b > < code > true< / code > or < code > false< / code >
< br > < b > Default value:< / b > < code > false< / code >
< / td >
< / tr >
< tr >
< td > < code > clockBold< / code > < / td >
< td > Remove the colon and bold the minutes to make a more modern look.< br >
2016-04-18 20:01:53 -04:00
< br > < b > Possible values:< / b > < code > true< / code > or < code > false< / code >
< br > < b > Default value:< / b > < code > false< / code >
< / td >
< / tr >
2016-09-11 08:14:28 -07:00
< tr >
< td > < code > showDate< / code > < / td >
< td > Turn off or on the Date section.< br >
< br > < b > Possible values:< / b > < code > true< / code > or < code > false< / code >
< br > < b > Default value:< / b > < code > true< / code >
< / td >
< / tr >
2016-07-08 17:16:51 -06:00
< tr >
< td > < code > displayType< / code > < / td >
< td > Display a digital clock, analog clock, or both together.< br >
< br > < b > Possible values:< / b > < code > digital< / code > , < code > analog< / code > , or < code > both< / code >
< br > < b > Default value:< / b > < code > digital< / code >
< / td >
< / tr >
< tr >
< td > < code > analogSize< / code > < / td >
2016-07-08 18:59:22 -06:00
< td > < strong > Specific to the analog clock.< / strong > Defines how large the analog display is.< br >
2016-07-08 17:16:51 -06:00
< br > < b > Possible values:< / b > A positive number of pixels< / code >
< br > < b > Default value:< / b > < code > 200px< / code >
< / td >
< / tr >
< tr >
< td > < code > analogFace< / code > < / td >
2016-07-08 18:59:22 -06:00
< td > < strong > Specific to the analog clock.< / strong > Specifies which clock face to use.< br >
2016-07-09 16:29:25 -06:00
< br > < b > Possible values:< / b > < code > simple< / code > for a simple border, < code > none< / code > for no face or border, or < code > face-###< / code > (where ### is currently a value between 001 and 012, inclusive)
2016-07-09 19:39:58 -06:00
< br > < b > Default value:< / b > < code > simple< / code >
2016-07-08 17:16:51 -06:00
< / td >
< / tr >
2016-07-08 18:57:23 -06:00
< tr >
< td > < code > secondsColor< / code > < / td >
2016-07-08 18:59:22 -06:00
< td > < strong > Specific to the analog clock.< / strong > Specifies what color to make the 'seconds' hand.< br >
2016-07-08 18:57:23 -06:00
< br > < b > Possible values:< / b > < code > any HTML RGB Color< / code >
< br >< b > Default value:</ b > < code > #888888 </ code >
< / td >
< / tr >
2016-07-08 17:16:51 -06:00
< tr >
< td > < code > analogPlacement< / code > < / td >
2016-07-08 19:00:11 -06:00
< td > < strong > Specific to the analog clock. < em > (requires displayType set to < code > 'both'< / code > )< / em > < / strong > Specifies where the analog clock is in relation to the digital clock< br >
2016-07-08 17:16:51 -06:00
< br > < b > Possible values:< / b > < code > top< / code > , < code > right< / code > , < code > bottom< / code > , or < code > left< / code >
< br > < b > Default value:< / b > < code > bottom< / code >
< / td >
< / tr >
2016-07-20 13:31:46 -06:00
< tr >
< td > < code > analogShowDate< / code > < / td >
< td > < strong > Specific to the analog clock.< / strong > If the clock is used as a separate module and set to analog only, this configures whether a date is also displayed with the clock.< br >
< br > < b > Possible values:< / b > < code > false< / code > , < code > top< / code > , or < code > bottom< / code >
< br > < b > Default value:< / b > < code > top< / code >
< / td >
< / tr >
2016-04-01 14:16:39 +02:00
< / tbody >
2016-09-11 08:14:28 -07:00
< / table >