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.

    MMM-doomsDay - The countdown module,

    Scheduled Pinned Locked Moved Utilities
    74 Posts 17 Posters 82.5k Views 16 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.
    • D Offline
      doubleT Module Developer
      last edited by

      @zdenek Even though I think it’s possible with a few changes to the code, I don’t think this would fit the scope of this module, which is to manually set a countdown to one specific event (noteven a few, right?) but not for a whole list of calendar dates.

      Even if the code ignores the year and just always shows the next event, does it make sense to have it display “364 days left” right the next day?

      Anyway, if you want to do that, I’d suggest adding:

          doomsDay: "2018-12-24 24:00:00",
          yearlyEvent: true,
          toWhat: "X-Mass"
      

      The most simple simple change to the code would be to add this at line 48:

      if (this.config.yearlyEvent && daysLeft < = 0) {
          var diff = now.getFullYear() - doomsday.getFullYear();
          // update doomsday:
          doomsDay.setFullYear(d.getFullYear() + diff);
          // calculate again:
          timeparser = Date.parse(doomsDay) - Date.parse(now);
          daysLeft = Math.floor(timeparser/(1000*60*60*24));
      }
      

      (remove the space between “< =” … )
      I didn’t test this, though, (and I don’t recommend it).

      zdenekZ 1 Reply Last reply Reply Quote 0
      • zdenekZ Offline
        zdenek @doubleT
        last edited by

        @doublet thanks, but this module seems to be easier way :-) anway, thanks a lot

        Zdeněk

        1 Reply Last reply Reply Quote 0
        • C Offline
          ChrizZz
          last edited by

          Is it possible to add more than 1 event and the module switches between the events with fade in and fade out?

          ? 1 Reply Last reply Reply Quote 0
          • ? Offline
            A Former User @ChrizZz
            last edited by

            @ChrizZz
            See https://github.com/eouia/MMM-CountEvents It could be done with group feature.

            1 Reply Last reply Reply Quote 1
            • M Offline
              MajorC Project Sponsor
              last edited by

              Hello,

              first of all thank you for the great modules. I am currently using it to display the time until my vacation.

              Since I speak German, I made a few changes in the code. But these are lost after an update and I copy & paste them back. Is there a better way to make these changes than fiddling around in the code?

              I change:

              ORIGINAL: headerD.innerHTML = this.config.toWhat + "</br>";
              MY:       headerD.innerHTML = this.config.toWhat;
              
              ORIGINAL: timeLeft.innerHTML = daysLeft + " " + this.config.singular;
              MY:       timeLeft.innerHTML = this.config.singular;
              
              ORIGINAL: timeLeft.innerHTML = daysLeft + " " + this.config.plural;
              MY:       timeLeft.innerHTML = " noch " + daysLeft + " " + this.config.plural;
              
              1 Reply Last reply Reply Quote 0
              • 1
              • 2
              • 3
              • 4
              • 5
              • 6
              • 7
              • 8
              • 8 / 8
              • 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