Git Product home page Git Product logo

mmm-datecounter's Introduction

MMM-DateCounter

Display a countdown or count up to a specfic date.

Screenshots

Long format with icon

Long format with icon

Long format without hours, minutes, or seconds

Long format without hours, minutes, or seconds

Default moment fromNow no icon

Default moment fromNow no icon

Default momenent fromNow with icon

Default momenent fromNow with icon

Regular installation

Open a terminal session, navigate to your MagicMirror's modules folder and execute git clone https://github.com/alltopafi/MMM-DateCounter.git, a new folder called MMM-DateCounter will be created.

Activate the module by adding it to the config.js file as shown below.

Configuration

{
    module: "MMM-DateCounter",
    position: "top_left",
    config: {
        updateInterval: 1000,
        remoteFile: null,
        eventDate: "2020-07-15",
        eventStartTime: "0:00",
        eventTitle: "Happy Birthday!",
        showLongCountdown: true,
        longCountdownFormat: "year,month,week,day,hour,minute,second",
        longCountdownAutoSize: true,
        icon: "/modules/MMM-DateCounter/birthday_cake.svg"
    }
}

Usage

updateInterval

How often the the module will update the countdown. Tip: If you using longCountdown set this to whatever your smallest unit is ie if including seconds set to 1000, if using minute as smallest unit use 60000.

Default:

updateInterval: 1000,

updateInterval

You can point to a remote config file instead of a local file.

Default:

remoteFile: null,

eventDate

The ISO 8601 date (YYYY-MM-dd) of the event you are counting to/from/

Default:

eventDate: "2020-07-15",

eventStartTime

The time (h:mm:-ss) that you the event starts/occurs.

Default:

eventStartTime: "0:00",

eventTitle

The title to be displayed above the counter.

Default:

eventTitle: "Happy Birthday!",

showLongCountdown

You can either use the default message from moment.js fromNow or a long countdown that will show a long format of any units included in longCountdownFormat that are applicable. ie If the event is 10 months away it would not show years.

Default:

showLongCountdown: true,

longCountdownFormat

List of units that you would like incuded in the longCountdown if applicable. Allowed values include year, month, week, day, hour, minute, second.

Default:

longCountdownFormat: "year,month,week,day,hour,minute,second",

longCountdownAutoSize

If this is enabled the font size will get larger as units fall off. ie When the countdown crosses from 1 month to 4 weeks, month will no longer be displayed and the font size will incrase to compensate for the new amount of space.

Default:

longCountdownAutoSize: true,

icon

You may include an image to show next to the countdown, this can be a local image (/modules/MMM-DateCounter/Flat_tick_icon.svg") (recommend adding to the root folder if this module), or you can use an image hosted on online. (https://upload.wikimedia.org/wikipedia/commons/7/73/Flat_tick_icon.sv). The module will automatically resize and place the image on the right side of the module.

Default:

icon: null,

mmm-datecounter's People

Contributors

alltopafi avatar michaelkastner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.