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

[Default clock] Incorrect week number

Scheduled Pinned Locked Moved Bug Hunt
showweek clock
14 Posts 4 Posters 2.4k 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.
  • P Offline
    p1lspeda
    last edited by Oct 18, 2022, 5:44 AM

    Hi,
    I was just playing around with my MagicMirror config and edited my default clock config to include the current week.

                    {
                            module: "clock",
                            position: "top_right",
                            config: {
                                    showWeek: true,
                            },
                    },
    

    There seems to be a small bug, because according to the other calendar and my Outlook calendar, we are currently in week 42 and not in week 43.

    2b2dd2e0-710b-4149-bf2c-a618f129c94f-image.png

    Not a big issue, but still an issue

    S 1 Reply Last reply Oct 18, 2022, 10:59 AM Reply Quote 0
    • S Offline
      sdetweil @p1lspeda
      last edited by Oct 18, 2022, 10:59 AM

      @p1lspeda where are you located

      in the US the week number is calculated differently then the rest of the world.

      Sam

      How to add modules

      learning how to use browser developers window for css changes

      T 1 Reply Last reply Oct 18, 2022, 11:27 AM Reply Quote 0
      • T Offline
        thgmirror @sdetweil
        last edited by Oct 18, 2022, 11:27 AM

        @sdetweil That is a good answer:-)

        I’m from Germany and my mirror shows 42, the answer to all questions.

        S 1 Reply Last reply Oct 18, 2022, 11:38 AM Reply Quote 0
        • S Offline
          sdetweil @thgmirror
          last edited by sdetweil Oct 18, 2022, 11:42 AM Oct 18, 2022, 11:38 AM

          @thgmirror where is your system timezone set?

          u can also set language and timezone in the clock config. I don’t know which influences the moment() library more

          Sam

          How to add modules

          learning how to use browser developers window for css changes

          T 1 Reply Last reply Oct 18, 2022, 11:51 AM Reply Quote 0
          • T Offline
            thgmirror @sdetweil
            last edited by Oct 18, 2022, 11:51 AM

            @sdetweil it is set to Berlin = CEST

            and my clock-config-entry is like this:

            //#################################################################################
            		{
            			disabled: false,
            			module: "clock",
            			position: "top_right",
            			config: {
            				// The config property is optional.
            				// See "Configuration options" for more information.
            				showWeek      : true,
            				showSunTimes  : true,
            				showMoonTimes : true,
            				lat           : 50.658821,
            				lon           : 7.193084,
            				}
            		},
            //#################################################################################
            
            S 1 Reply Last reply Oct 18, 2022, 12:28 PM Reply Quote 0
            • S Offline
              sdetweil @thgmirror
              last edited by Oct 18, 2022, 12:28 PM

              @thgmirror is your MM running in English or German? I see the code set moment from the language set in config.js

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              T 1 Reply Last reply Oct 18, 2022, 1:21 PM Reply Quote 0
              • T Offline
                thgmirror @sdetweil
                last edited by Oct 18, 2022, 1:21 PM

                @sdetweil said in [Default clock] Incorrect week number:

                I see the code set moment from the language set in config.js

                DE

                S 1 Reply Last reply Oct 18, 2022, 1:44 PM Reply Quote 0
                • S Offline
                  sdetweil @thgmirror
                  last edited by sdetweil Oct 18, 2022, 1:54 PM Oct 18, 2022, 1:44 PM

                  @p1lspeda let’s try this

                  edit clock.js

                  and change line 248

                  from ending like this

                  weekNumber: now.week() });
                  

                  to this

                  weekNumber: now.isoWeek() });
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  T 1 Reply Last reply Oct 18, 2022, 1:48 PM Reply Quote 0
                  • T Offline
                    thgmirror @sdetweil
                    last edited by Oct 18, 2022, 1:48 PM

                    @sdetweil Hey…I have no issue:-) it is @p1lspeda

                    S 1 Reply Last reply Oct 18, 2022, 1:54 PM Reply Quote 0
                    • S Offline
                      sdetweil @thgmirror
                      last edited by Oct 18, 2022, 1:54 PM

                      @thgmirror sorry, didn’t see u sneak a post in there. fixed

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      T 1 Reply Last reply Oct 18, 2022, 1:57 PM Reply Quote 0
                      • 1
                      • 2
                      • 1 / 2
                      1 / 2
                      • First post
                        5/14
                        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