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

Any plan to replace "request" and "moment"?

Scheduled Pinned Locked Moved Unsolved Feature Requests
61 Posts 8 Posters 24.8k 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.
  • M Offline
    MMRIZE @sdetweil
    last edited by MMRIZE Aug 31, 2021, 3:41 PM Aug 31, 2021, 3:20 PM

    @sdetweil said in Any plan to replace "request" and "moment"?:

    what day of the week is 1/1, subtract that from 7, and then that is the start of the weekly cycle.

    ISOWeek is easy. Conventional week is the problem.

    For example, in the United States, Sunday is the first day of the week. The week with January 1st in it is the first week of the year.

    In France, Monday is the first day of the week, and the week with January 4th is the first week of the year. It means January 1st could be the last week of the last year sometimes. And Jan. 10th could be the first week in certain year.

    And in other countries, there is also their own rule.

    This might be important in some European countries, because they use week number in real life (“my vacation ends 23. Weeks“)

    B 1 Reply Last reply Aug 31, 2021, 9:39 PM Reply Quote 0
    • B Offline
      BKeyport Module Developer @MMRIZE
      last edited by Aug 31, 2021, 9:16 PM

      @mmrize I care about safari. 😢😢😢

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

      0 1 Reply Last reply Sep 1, 2021, 6:49 AM Reply Quote 0
      • B Offline
        BKeyport Module Developer @sdetweil
        last edited by Aug 31, 2021, 9:39 PM

        @mmrize said in Any plan to replace "request" and "moment"?:

        Once (yesterday), I’ve tried to rewrite clock module and calendar module
        without momentjs or any other 3rd party library, only with Date and Intl.

        The start was not so bad. I could rewrite many features with only Date and Intl.
        Where I stuck was the showWeek config feature. It has to show the ordinal number of weeks of the year. To calculate ISOweek is not difficult. But in some areas, like the US. they never use the ISO system. damn!. To calculate the conventional US week number, additional pieces of information are needed. (read this.) Current Intl has not yet that feature. I’m waiting for Temporal and enhanced Intl releasing.

        Where I’m getting stuck with Luxon is basic comparision of dates:

        Is this time the same or before that time? 
        Moment: m1.isSameOrBefore(m2) (works) 
        Luxon:  dt1 <= dt2 (Crashes jsfiddle) 
        

        and querying luxon for the locale’s weekday strings is always returning Monday as first, even though it will treat the week correctly otherwise.

        luxon.info.weekdays('short') == Mon
        

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

        1 Reply Last reply Reply Quote 0
        • B Offline
          BKeyport Module Developer @MMRIZE
          last edited by Aug 31, 2021, 9:39 PM

          @mmrize said in Any plan to replace "request" and "moment"?:

          @sdetweil said in Any plan to replace "request" and "moment"?:

          what day of the week is 1/1, subtract that from 7, and then that is the start of the weekly cycle.

          ISOWeek is easy. Conventional week is the problem.

          For example, in the United States, Sunday is the first day of the week. The week with January 1st in it is the first week of the year.

          In France, Monday is the first day of the week, and the week with January 4th is the first week of the year. It means January 1st could be the last week of the last year sometimes. And Jan. 10th could be the first week in certain year.

          And in other countries, there is also their own rule.

          This might be important in some European countries, because they use week number in real life (“my vacation ends 23. Weeks“)

          Moment handles this automatically. Everyone else, not so much.

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

          1 Reply Last reply Reply Quote 0
          • 0 Offline
            0m4r Module Developer @BKeyport
            last edited by Sep 1, 2021, 6:49 AM

            @bkeyport many do, and you are not alone.
            But how many people are running MM in a safari browser?

            I guess this is the relevant point here :)

            https://github.com/0m4r

            B 1 Reply Last reply Sep 1, 2021, 9:11 AM Reply Quote 0
            • B Offline
              BKeyport Module Developer @0m4r
              last edited by Sep 1, 2021, 9:11 AM

              @0m4r When I’m testing something, I’ll load it up on my local machine, which is a Mac, and yes, I use Safari. :)

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

              0 1 Reply Last reply Sep 2, 2021, 8:43 AM Reply Quote 1
              • 0 Offline
                0m4r Module Developer @BKeyport
                last edited by Sep 2, 2021, 8:43 AM

                @bkeyport same for me, even tho I am aware like 99% of MM users are running it out of a raspberry pi with a Chromium browser.
                That is the reason I say the main focus could be on Chromium-based browsers rather than others.

                https://github.com/0m4r

                C 1 Reply Last reply Sep 2, 2021, 11:43 PM Reply Quote 0
                • C Offline
                  cowboysdude Module Developer @0m4r
                  last edited by Sep 2, 2021, 11:43 PM

                  I’m using Brave which is Chrome based without all the tracking and such ;)

                  0 1 Reply Last reply Sep 3, 2021, 5:45 AM Reply Quote 0
                  • 0 Offline
                    0m4r Module Developer @cowboysdude
                    last edited by Sep 3, 2021, 5:45 AM

                    @cowboysdude technically it is based on Chromium (https://www.chromium.org/).

                    https://github.com/0m4r

                    C 1 Reply Last reply Sep 3, 2021, 11:16 AM Reply Quote 1
                    • C Offline
                      cowboysdude Module Developer @BKeyport
                      last edited by Sep 3, 2021, 11:15 AM

                      @bkeyport I wouldn’t worry about it. Moment will be around for a while. Easy to use and yes you can add it to your own package json file and still use it.

                      Request…not so much LOL

                      B 1 Reply Last reply Sep 3, 2021, 8:43 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 7
                      • 4 / 7
                      4 / 7
                      • First post
                        40/61
                        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