MagicMirror Forum

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

    Time format in default calendar module

    Troubleshooting
    2
    3
    310
    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
      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
        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

        Create a working config
        How to add modules

        C 1 Reply Last reply Reply Quote 0
        • C
          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 Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
          This forum is using NodeBB as its core | Contributors
          Contact | Privacy Policy