• 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.

Weather forecast only displays 'invalid date'

Scheduled Pinned Locked Moved Solved Troubleshooting
21 Posts 9 Posters 14.9k Views 8 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.
  • S Offline
    SoleLo @Bob
    last edited by Jul 3, 2018, 5:46 AM

    @bob how did you get you icons to change color as well as your text?

    1 Reply Last reply Reply Quote 0
    • A Offline
      AgP42 Project Sponsor Module Developer @killing joke
      last edited by Jul 3, 2018, 9:23 AM

      @killing-joke said in Weather forecast only displays ‘invalid date’:

      I found a solution on https://github.com/MichMich/MagicMirror/commit/0e2e8d2e2aca2f8d0f1f2eb7b213577fcc4f623a
      But I had to change the lines 338 and 339 instead of 336 and 337

      var day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
      var hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
      

      into

      var day;
      var hour;
      if(!!forecast.dt_txt) {
      	day = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("ddd");
      	hour = moment(forecast.dt_txt, "YYYY-MM-DD hh:mm:ss").format("H");
      } else {
      	day = moment(forecast.dt, "X").format("ddd");
      	hour = moment(forecast.dt, "X").format("H");
      }
      

      It works for my MM.

      Works fine, thank you for the advice !

      1 Reply Last reply Reply Quote 0
      • M Offline
        MichMich Admin
        last edited by MichMich Jul 3, 2018, 3:12 PM Jul 3, 2018, 3:12 PM

        Ive just merged the fix by @jannekalliola into the develop branch which should solve this issue: https://github.com/MichMich/MagicMirror/pull/1341

        Can you guys please test this develop branch? If this solves the issue, I’ll release an intermediate 2.4.1 release.

        To tryout the develop branch, use the following git command on your terminal (from within the MagicMirror folder):

        git checkout develop 
        git pull
        

        Thanks for testing!

        1 Reply Last reply Reply Quote 0
        • S Offline
          SoleLo
          last edited by Jul 3, 2018, 4:36 PM

          I edited the code snippet and now my time is stuck on 8:01 on the current forecast…

          1 Reply Last reply Reply Quote 0
          • R Offline
            Richard238
            last edited by Jul 3, 2018, 5:12 PM

            Stuck time might be the sunset time. Mine is 21:17, so not stuck al all.

            S 1 Reply Last reply Jul 3, 2018, 5:15 PM Reply Quote 0
            • S Offline
              SoleLo @Richard238
              last edited by Jul 3, 2018, 5:15 PM

              @richard238 hahaha you are right, I’m a imbecile.

              1 Reply Last reply Reply Quote 0
              • B Offline
                Bob
                last edited by Jul 5, 2018, 1:30 PM

                Awesome, v2.4.1 fixed it

                Thanks @MichMich :)

                1 Reply Last reply Reply Quote 0
                • 1
                • 2
                • 3
                • 2 / 3
                2 / 3
                • First post
                  19/21
                  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