MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    SOLVED Calendar Event Display start and end date

    Troubleshooting
    2
    7
    286
    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
      pastormingle last edited by

      Re: How to display start and end times/dates of events in calendarI’ve not been able to set all-day events to display start and end dates. Any guidance here?

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

        @pastormingle eh,???

        Sam

        Create a working config
        How to add modules

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

          @pastormingle there is a bug

          edit
          modules/default/calendar/calendar.js

          						timeWrapper.innerHTML += this.capFirst(moment(event.endDate, "x").format(this.config.dateEndFormat));
          					} else    // <---- add this else, line 338
          					// For full day events we use the fullDayEventDateFormat
          					if (event.fullDayEvent) {
          

          config options

          showEnd: true
          timeFormat: “absolute”

          Sam

          Create a working config
          How to add modules

          P 1 Reply Last reply Reply Quote 0
          • P
            pastormingle @sdetweil last edited by

            @sdetweil Don’t think i am doing this right as it’s not loading the calendar.js file now… Do I just copy this to the bottom of the file the same it?

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

              @pastormingle now. you add the word ‘else’

              to the line I documented.

              what do u mean not loading?

              did u edit that file like the other one I had u correct?

              Sam

              Create a working config
              How to add modules

              P 1 Reply Last reply Reply Quote 0
              • P
                pastormingle @sdetweil last edited by

                @sdetweil if (this.config.timeFormat === “absolute”) {
                // Use dateFormat
                timeWrapper.innerHTML = this.capFirst(moment(event.startDate, “x”).format(this.config.dateFormat));
                // Add end time if showEnd
                if (this.config.showEnd) {
                timeWrapper.innerHTML += “-”;
                timeWrapper.innerHTML += this.capFirst(moment(event.endDate, “x”).format(this.config.dateEndFormat));
                }
                // For full day events we use the fullDayEventDateFormat
                if (event.fullDayEvent) {
                //subtract one second so that fullDayEvents end at 23:59:59, and not at 0:00:00 one the next day
                event.endDate -= oneSecond;
                timeWrapper.innerHTML = this.capFirst(moment(event.startDate, “x”).format(this.config.fullDayEventDateFormat));
                }

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

                  @pastormingle eh,???

                  Sam

                  Create a working config
                  How to add modules

                  P 1 Reply Last reply Reply Quote 0
                  • P
                    pastormingle @sdetweil last edited by

                    @sdetweil Ok i think i got it now…
                    if (this.config.showEnd) {
                    timeWrapper.innerHTML += “-”;
                    timeWrapper.innerHTML += this.capFirst(moment(event.endDate, “x”).format(this.config.dateEndFormat));
                    } else
                    // For full day events we use the fullDayEventDateFormat
                    if (event.fullDayEvent) {

                    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