ulrichwisser / MMM-Worldclock

This is my first Node.JS module for MagicMirror^2. This module could display several world-wide local times.
37 stars 19 forks source link

Override timeFormat doesn't work. #7

Closed BKeyport closed 4 years ago

BKeyport commented 4 years ago

Ulrich,

I can't get the override of timeFormat to work, am I doing something wrong? I'm trying to get a 24 hour clock only on the UTC clock. "LT" is "hh:mm A" here...

Thanks!

{ module: "worldclock", position: "top_left", config: { timeFormat: "LT", style: "left", offsetTimezone: null, clocks: [ { title: "Local", timezone: "America/Los_Angeles", }, { title: "UTC", timezone: "UTC", timeFormat: "HH:mm", }, { title: "ET", timezone: "America/New_York", }, { title: "CT", timezone: "America/Chicago", }, { title: "MT", timezone: "America/Boise", }, ] }, },

BKeyport commented 4 years ago

Solved it in my fork.

in worldclock.js

   var timeString

    if (c.timeFormat == null || undefined ) {
      timeString = clock.format(this.config.timeFormat)
    } else {
      timeString = clock.format(c.timeFormat)
    }

    //var timeString
    //timeString = clock.format(this.config.timeFormat)

PS: If you'd like, I'd be happy to take care of the module instead of you. Just let me know.