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

Calendar - Change DateFormat to DD MM YYY

Scheduled Pinned Locked Moved Troubleshooting
6 Posts 4 Posters 858 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.
  • R Offline
    runny
    last edited by Mar 27, 2021, 4:09 PM

    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 Mar 27, 2021, 4:52 PM Reply Quote -1
    • S Offline
      scumbelly
      last edited by Mar 27, 2021, 4:45 PM

      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 Away
        sdetweil @runny
        last edited by Mar 27, 2021, 4:52 PM

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

        			timeFormat:'absolute',
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 1
        • R Offline
          runny
          last edited by Mar 28, 2021, 10:27 AM

          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 Mar 28, 2021, 12:20 PM Reply Quote 0
          • S Away
            sdetweil @runny
            last edited by Mar 28, 2021, 12:20 PM

            @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

            How to add modules

            learning how to use browser developers window for css changes

            1 Reply Last reply Reply Quote 0
            • U Offline
              uncleLem
              last edited by uncleLem Mar 29, 2021, 11:36 PM Mar 29, 2021, 11:35 PM

              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
              1 / 1
              • First post
                5/6
                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