MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord
    MagicMirror² v2.20.0 is available! For more information about this release, check out this topic.

    Calendar - Change DateFormat to DD MM YYY

    Troubleshooting
    4
    6
    158
    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.
    • R
      runny last edited by

      Hello,
      just starting out with the MagicMirror and doing my first steps with it. One thing I am struggling with is to change the date format, when it is set to “relative”. There I get MM DD YYYY but I would like to have DD MM YYYY.

      When changing to absolute I can freely adjust the format. Is there any trick where / how I can do this with the relative format?

      Here is a look at my config.js:

      {
      			module: "calendar",
      			header: "...",
      			position: "bottom_right",
      			config: {
      				fade : true,
      				timeFormat: "relative",
      				dateFormat: "DD/MM/YYYY - HH:mm",
      				calendars: [
      					{
      						symbol: "calendar-check-o",
      						url: "..."					}
      				]
      			},
      					
      		},
      
      S 1 Reply Last reply Reply Quote -1
      • S
        scumbelly last edited by

        Hi,

        The default in the .js is dateFormat: “MMM Do”, for fun have you tried “Do MMM”?

        Cheers.

        1 Reply Last reply Reply Quote 1
        • S
          sdetweil @runny last edited by

          @runny to chnage the date formats, you also need to specify

          			timeFormat:'absolute',
          

          Sam

          Create a working config
          How to add modules

          1 Reply Last reply Reply Quote 1
          • R
            runny last edited by

            Hello scumbelly and sdetweil,

            Thanks for your help and quick responses here! I have tried what you have suggested scumbelly but with no result. As sdetweil indicates the dateFormat does only change, when you specify timeFormat as absolute.

            And that is kind of my problem…I can change the dateFormat but only when switching to absolute. But for the latest appointments I’d prefer to have it in relative format. As I understand it this should be possible also by using the “urgency” and “getRelative” variables but then I run into another problem - the relative date that is shown is different than when I have timeFormat as relative (no days, no times).

            I have attached two pictures marking what I’d like to have (green) and what I’d not like to have (red) and hope this explains what I want to achieve:

            alt text

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

              @runny yes, I understand. However, the code doesn’t support that.

              it’s
              relative and no user specified formats,
              or
              absolute and user specified formats

              Sam

              Create a working config
              How to add modules

              1 Reply Last reply Reply Quote 0
              • uncleLem
                uncleLem last edited by uncleLem

                Hi, I’ve also tried to achieve it, but due to differences in grammar in different languages support of relative calendar customization is a little bit tricky, so maintainers decided not to accept my change (more details here).

                However, if you’re willing to do it, you can create a fork from the original repository on the github, and then pull my changes from this branch containing my changes. Depending on what exactly you’re trying to achieve, you might need to do some further tinkering with the calendar.js, because this solution was tailored for my needs and I was focusing on full day events, but there’s a fullDayEventDateFormat config option that might help you.

                1 Reply Last reply Reply Quote 1
                • 1 / 1
                • First post
                  Last post
                Enjoying MagicMirror? Please consider a donation!
                MagicMirror created by Michael Teeuw.
                Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
                This forum is using NodeBB as its core | Contributors
                Contact | Privacy Policy