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.

    Do you need to list moment and moment-timezone as dependencies in modules?

    Scheduled Pinned Locked Moved Development
    9 Posts 4 Posters 713 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.
    • BKeyportB Offline
      BKeyport Module Developer @KristjanESPERANTO
      last edited by

      @KristjanESPERANTO I’ve noticed that it seems that most of the functions of moment is in vanilla javascript - at least in what we typically use.

      The "E" in "Javascript" stands for "Easy"

      D 1 Reply Last reply Reply Quote 1
      • D Offline
        dathbe @KristjanESPERANTO
        last edited by

        @KristjanESPERANTO - while true, I also plan to replace moment when temporal is available

        1 Reply Last reply Reply Quote 1
        • D Offline
          dathbe @BKeyport
          last edited by

          @BKeyport I couldn’t get timezones working properly. So, for example, if you want to know what day it is, and you’re not on UTC, you’re liable to pull tomorrow’s date. Maybe I don’t know how to do it, but moment is pretty lightweight and makes a few things slightly easier.

          S 1 Reply Last reply Reply Quote 0
          • S Offline
            sdetweil @dathbe
            last edited by

            @dathbe you need moment.timezone

            Sam

            How to add modules

            learning how to use browser developers window for css changes

            D 1 Reply Last reply Reply Quote 1
            • D Offline
              dathbe @sdetweil
              last edited by

              @sdetweil Maybe I’m wrong, and I haven’t spent a lot of time trying to test it, but I think regular moment will grab the date in the local timezone based on what is set in the system. You can’t do as much with OTHER timezones in regular moment, but I think at least that works. Whereas the regular javascript date will pull the date and time in UTC. That said, I do use moment-timezone in my modules–though some of them I have taken over maintaining, and they used regular moment to some success.

              1 Reply Last reply Reply Quote 0
              • 1 / 1
              • 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