• Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
MagicMirror Forum
  • Recent
  • Tags
  • Unsolved
  • Solved
  • MagicMirror² Repository
  • Documentation
  • 3rd-Party-Modules
  • Donate
  • Discord
  • Register
  • Login
A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.

Simple daily countdown timer

Scheduled Pinned Locked Moved Unsolved Requests
20 Posts 4 Posters 7.2k Views 4 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    Mykle1 Project Sponsor Module Developer @andreasm80
    last edited by Oct 24, 2018, 7:40 PM

    @andreasm80 said in Simple daily countdown timer:

    I am aslo using two of your modules @Mykle1 (Earth and Lunartic).

    Ahh, in that case, I thank you twice! :thumbsup:

    Create a working config
    How to add modules

    1 Reply Last reply Reply Quote 0
    • R Offline
      Richard238 @Mykle1
      last edited by Nov 24, 2018, 2:26 PM

      @mykle1 I just added this module as it looks good for something I would like to do.
      However, nothing happens. MM starts up OK, but the module doesn’t show.

      		{
              disabled: false,
              module: 'MMM-EventHorizon',
              position: 'bottom_right',
      	config: {
                  size: "large", // small, medium or large
      	    countUp: "yes", // Yes or no (when timer ends)
                  date: "2018-12-03", // (YYYY-MM-DD)  Date timer will end
                  time: "00:00:01", // (HH:MM:SS)    Exact time you want timer to end
      	    text1: "Open the damn pool", // 1st line of text during timer. About 18 characters total.
                  text2: "Winter sucked ass", // 2nd line of text during timer. About 18 characters total.
                  endText1: "It's gonna be fun", // 1st line of text when timer ends. About 18 characters total.
                  endText2: "Where's my bikini", // 2nd line of text when timer ends. About 18 characters total.
          }
      },             
         
      

      GitHub shows - disabled: f,
      Here it shows - disabled: false,

      Is that an issue?

      Thanks.

      ? M 2 Replies Last reply Nov 24, 2018, 3:11 PM Reply Quote 0
      • ? Offline
        A Former User @Richard238
        last edited by Nov 24, 2018, 3:11 PM

        @richard238
        true/false is a predefined javascript type. ‘false’ (without quotation marks) is right.

        1 Reply Last reply Reply Quote 0
        • M Offline
          Mykle1 Project Sponsor Module Developer @Richard238
          last edited by Mykle1 Nov 24, 2018, 9:58 PM Nov 24, 2018, 9:57 PM

          @richard238 said in Simple daily countdown timer:

          GitHub shows - disabled: f,

          I just checked the repo. I inserted vars for true and false in my config so I don’t have to type the entire word. A little trick my guru taught me. However, I don’t find that in the config example there.

          {
                  disabled: false,
                  module: 'MMM-EventHorizon',
                  position: 'bottom_center',
          	    config: {
                      size: "large",                       // small, medium or large
          	    countUp: "yes",                      // Yes or no (when timer ends)
                      date: "2018-07-04",                  // (YYYY-MM-DD)  Date timer will end
                      time: "00:00:01",                    // (HH:MM:SS)    Exact time you want timer to end
          	    text1: "Open the damn pool",         // 1st line of text during timer. About 18 characters total.
                      text2: "Winter sucked ass",          // 2nd line of text during timer. About 18 characters total.
                      endText1: "It's gonna be fun",          // 1st line of text when timer ends. About 18 characters total.
                      endText2: "Where's my bikini",          // 2nd line of text when timer ends. About 18 characters total.
              }
          },
          

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 1
          • R Offline
            Richard238
            last edited by Richard238 Nov 25, 2018, 12:09 PM Nov 25, 2018, 11:47 AM

            OK, got it working now.

            Had to fudge the time to make it work for GMT.
            How do you change the time zone properly?

            M 1 Reply Last reply Nov 25, 2018, 8:35 PM Reply Quote 0
            • M Offline
              Mykle1 Project Sponsor Module Developer @Richard238
              last edited by Nov 25, 2018, 8:35 PM

              @richard238 said in Simple daily countdown timer:

              How do you change the time zone properly?

              Because this is an iframe/module that is not very easy to do. However, I can tell you how to fix yours. I’ll make it easy.

              0_1543177343777_Screenshot from 2018-11-25 15-18-48.png

              In your MMM-EventHorizon.js file, lines 38, 41, 44, 50, 52 and 54 (see picture) at the end of each line, between the last 2 “/” is the value n179. See it in the picture? For GMT you would change that to n136. Change only that in each line. Save.

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 1
              • R Offline
                Richard238
                last edited by Nov 25, 2018, 10:08 PM

                @mykle1 said in Simple daily countdown timer:

                n179

                					if (this.config.countUp == "yes" && this.config.size == "small"){
                
                						// small
                
                						iframe.src = "http://free.timeanddate.com/countdown/i6f519yg/n136/cf12/cm0/cu4/ct0/cs0/ca0/cr0/ss0/cac0ff/cpc0ff/pc000/tcfff/fs100/szw256/szh108/tat" + this.config.text1 + "/tac0ff/tpt" + this.config.endText1 + "/tpc0ff/mat" + this.config.text2 + "/mac0ff/mpt" + this.config.endText2 + "/mpc0ff/iso" + this.config.date + "T" + this.config.time;
                
                					} else if (this.config.countUp == "yes" && this.config.size == "medium") {
                
                						// medium
                
                						iframe.src = "http://free.timeanddate.com/countdown/i6f519yg/n136/cf12/cm0/cu4/ct0/cs0/ca0/cr0/ss0/cac0ff/cpc0ff/pc000/tcfff/fs100/szw320/szh135/tat" + this.config.text1 + "/tac0ff/tpt" + this.config.endText1 + "/tpc0ff/mat" + this.config.text2 + "/mac0ff/mpt" + this.config.endText2 + "/mpc0ff/iso" + this.config.date + "T" + this.config.time;
                
                					} else if (this.config.countUp == "yes" && this.config.size == "large") {
                
                					  // large
                
                						iframe.src = "http://free.timeanddate.com/countdown/i6f519yg/n136/cf12/cm0/cu4/ct0/cs0/ca0/cr0/ss0/cac0ff/cpc0ff/pc000/tcfff/fs100/szw576/szh243/tat" + this.config.text1 + "/tac0ff/tpt" + this.config.endText1 + "/tpc0ff/mat" + this.config.text2 + "/mac0ff/mpt" + this.config.endText2 + "/mpc0ff/iso" + this.config.date + "T" + this.config.time;
                
                					}
                
                
                
                
                
                
                
                        if (this.config.countUp != "yes" && this.config.size == "small"){
                
                            iframe.src = "http://free.timeanddate.com/countdown/i64zeztz/n136/cf100/cm0/cu4/ct5/cs0/ca0/cr0/ss0/cac33d9ff/cpc000/pct/tcfff/fs100/szw192/szh81/tat" + this.config.text1 + "/tac33d9ff/tpt" + this.config.endText1 + "/tpc33d9ff/mat" + this.config.text2 + "/mac33d9ff/mpt" + this.config.endText2 + "/mpc33d9ff/iso" + this.config.date + "T" + this.config.time + "/bo2/pd2";
                
                        } else if (this.config.countUp != "yes" && this.config.size == "medium") {
                
                            iframe.src = "http://free.timeanddate.com/countdown/i67bgd3d/n136/cf12/cm0/cu4/ct0/cs1/ca0/cr0/ss0/cac0ff/cpc0ff/pct/tcfff/fs100/szw448/szh189/tat" + this.config.text1 + "/tac0ff/tpt" + this.config.endText1 + "/tpc0ff/mat" + this.config.text2 + "/mac0ff/mpt" + this.config.endText2 + "/mpc0ff/iso" + this.config.date + "T" + this.config.time + "/bo2/pd2";
                
                        } else if (this.config.countUp != "yes" && this.config.size == "large") {
                
                            iframe.src = "http://free.timeanddate.com/countdown/i67bgd3d/n136/cf12/cm0/cu4/ct0/cs1/ca0/cr0/ss0/cac0ff/cpc0ff/pct/tcfff/fs100/szw576/szh243/tat" + this.config.text1 + "/tac0ff/tpt" + this.config.endText1 + "/tpc0ff/mat" + this.config.text2 + "/mac0ff/mpt" + this.config.endText2 + "/mpc0ff/iso" + this.config.date + "T" + this.config.time + "/bo2/pd2";
                
                        }
                

                Changed n179 to n136, as shown.
                Stopped and restarted MM.
                Did not change time in config.js, and expected results to now be incorrect, but there’s no change.
                The module still shows the correct time for my countdown.

                M 2 Replies Last reply Nov 25, 2018, 10:53 PM Reply Quote 0
                • M Offline
                  Mykle1 Project Sponsor Module Developer @Richard238
                  last edited by Mykle1 Nov 25, 2018, 11:00 PM Nov 25, 2018, 10:53 PM

                  @richard238

                  Ok, give me some time. I’m in the middle of trying to fix another module at the same time. In the meantime, continue to use it with your “fudging” if you like. Sorry about the inconvenience.

                  Create a working config
                  How to add modules

                  1 Reply Last reply Reply Quote 1
                  • M Offline
                    Mykle1 Project Sponsor Module Developer @Richard238
                    last edited by Nov 25, 2018, 11:05 PM

                    @richard238

                    Ok, wait. I just did exactly what I asked you to do yours and tested it. It works as I said it would. I set the date and time for midnight tonight. As you can see from my screenshot, my clock reports the current time of 5:57pm, yet MMM-EventHorizon reports the correct time if I were in GMT. I think you have something else going on there.

                    0_1543187129505_44.png

                    Create a working config
                    How to add modules

                    R ? 2 Replies Last reply Nov 26, 2018, 9:50 AM Reply Quote 1
                    • R Offline
                      Richard238 @Mykle1
                      last edited by Nov 26, 2018, 9:50 AM

                      @mykle1 Peculiar. I’ve no idea why it’s giving different results for you.
                      I’ll have a play when I have time, but for now the ‘fudge-fix’ (deducting five hours in config.js) works ok for me.

                      Thank you!

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 2 / 2
                      • First post
                        Last post
                      Enjoying MagicMirror? Please consider a donation!
                      MagicMirror created by Michael Teeuw.
                      Forum managed by Sam, technical setup by Karsten.
                      This forum is using NodeBB as its core | Contributors
                      Contact | Privacy Policy