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.

    Time format in default calendar module

    Scheduled Pinned Locked Moved Troubleshooting
    3 Posts 2 Posters 716 Views 2 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.
    • C Offline
      codac
      last edited by

      I would like to change the way the time information gets displayed within the default calendar module.

      The first entry says “In 6 hours”, instead I would like it to display "“Today at 12:00”
      The second entry says “Today at 20:00 o’clock” and I would like to remove the “o’clock” at the end and habe instead "Today at 20:00 "

      mm.JPG

      How would the config look like?

      My config:

                              module: "calendar",
                              header: "Calednarname",
                              position: "top_right",
                              config: {
                                      displaySymbol: false,
                                      maxTitleLength: 20,
                                      showLocation: false,
                                      wrapEvents: true,
                                      maxTitleLines: 3,
                                      nextDaysRelative: true,
                                      selfSignedCert: true,
                                      timeFormat : "relative",
                                      dateFormat: "Do MMM",
                                      fullDayEventDateFormat : "Do MMM",
                                      displayRepeatingCountTitle: true,
                                      calendars: [
                                              {
                                                      url: "<calendar-url>",
                                              },
                                      ],
                              },
      
      
      S 1 Reply Last reply Reply Quote 0
      • S Away
        sdetweil @codac
        last edited by

        @codac u can set the date or time format to be from the moment() library

        https://devhints.io/moment

        note that you may also have to set formatFixed
        (I may not be spelling these correctly)

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          codac @sdetweil
          last edited by

          @sdetweil I know and this is what I did. But it seems that the calendar module is not respecting the flags that have been set. Maybe a bug?

          What I understand out of the doc is that the format can only be changed if the timeFormat is absolute.
          But to be honest, in my case it just doesn’t matter at all. The format won’t change, no matter if I use relative or absolute.

          With Absolute it always says “In one day”
          With relative it says “Tomorrow at 12:00 o’clock”

          The values for dateFormat seem to get ignored.
          I tried “DD-MM-YYYY”, “MMM Do”, “LT” for both cases relative and absolute.

          What am I missing?

          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