MagicMirror Forum

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

    Absolute date

    Troubleshooting
    4
    9
    4395
    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.
    • D
      deadherring last edited by

      I am trying to get the calendar module display my calendar in absolute date. I want appointments to read the actual time of the appointment, e.g. “3PM”

      This is what my MM is doing:

      Appointment today: in an hour
      Appointment tomorrow: Tomorrow at 11 AM
      Appointment 2 days from now: Tuesday at 12PM
      Appointment 4 days from now: In 4 days

      Here’s the calendar part of my config.js: (apologies, I know I’m supposed to post this in markdown but am not sure how)

      {
      module: ‘calendar’,
      header: ‘Calendar’,
      position: ‘top_left’,
      config: {
      calendars: [
      {
      symbol: 'calendar-check-o ',
      url: ‘redacted’,

      				},
      

      {
      symbol: ‘rocket’,
      url: ‘redacted’
      }

      			]
      

      Here’s what the top part of my calendar.js file looks like:

      Module.register(“calendar”,{

      // Define module defaults
      defaults: {
      	maximumEntries: 10, // Total Maximum Entries
      	maximumNumberOfDays: 365,
      	displaySymbol: true,
      	defaultSymbol: "calendar", // Fontawesome Symbol see http://fontawesome.io/cheatsheet/
      	displayRepeatingCountTitle: false,
      	defaultRepeatingCountTitle: '',
      	maxTitleLength: 15,
      	fetchInterval: 5 * 60 * 1000, // Update every 5 minutes.
      	animationSpeed: 2000,
      	fade: false,
      	urgency: 7,
      	timeFormat: "absolute",
      	fadePoint: 0.25, // Start on 1/4th of the list.
      	calendars: [
      		{
      			symbol: "calendar",
      			url: "http://www.calendarlabs.com/templates/ical/US-Holidays.ics",
      		},
      	],
      	titleReplace: {
      		"De verjaardag van ": "",
      		"'s birthday": ""
      	},
      },
      

      Any help is appreciated.

      Nathan

      D 1 Reply Last reply Reply Quote 0
      • D
        deadherring @deadherring last edited by

        Anyone? Does anyone have absolute date working as I describe? Can someone post the relevant portion of their config file so I can see what you’ve done?

        Thanks.

        1 Reply Last reply Reply Quote 0
        • M
          mjtice last edited by

          Any word on this? I’m using a 7" raspberry pi display and that ‘Tomorrow at 10:00 AM’ eats up a lot of real estate.

          Here’s my config:

                      {
                              module: 'calendar',
                              header: 'My Calendar',
                              position: 'top_right',
                              config: {
                                calendars: [
                                  {
                                    symbol: 'calendar-check-o ',
                                    url: '[redacted]'
                                  }
                                ],
                                maximumEntries: 10,
                                maxTitleLength: 12,
                                titleReplace: {'Appointment':'Appt'},
                                displaySymbol: false,
                                timeFormat: 'relative'
                              }
                      },
          
          1 Reply Last reply Reply Quote 0
          • M
            mjtice last edited by

            … and by
            {
            timeFormat: ‘relative’
            }

            I mean
            {
            timeFormat: ‘absolute’
            }
            ugh.

            1 Reply Last reply Reply Quote 0
            • M
              mjtice last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • M
                mjtice last edited by

                Turns out my problem came down mostly to not really understanding the difference between ‘absolute’ and ‘relative’… I fixed my problem by modifying the code in calendar.js slightly.

                 // Otherwise just say 'Today/Tomorrow at such-n-such time'
                 timeWrapper.innerHTML = moment(event.startDate, "x").calendar(null, {
                                                                        sameDay: 'H:mm',
                                                                        nextDay: '[Tomorrow] H:mm',
                                                                        nextWeek: 'dddd',
                                                                        lastDay: '[Yesterday]',
                                                                        lastWeek: '[Last] dddd',
                                                                        sameElse: 'DD/MM/YYYY'
                                                                    });
                

                I sort of hijacked this thread. Sorry (but I think my solution might help out the OP ).

                D D 2 Replies Last reply Reply Quote 0
                • D
                  daikaiju @mjtice last edited by

                  @mjtice What lines did you implement that code on?

                  M 1 Reply Last reply Reply Quote 0
                  • D
                    DeanoAus @mjtice last edited by

                    @mjtice Thanks man, that solved my problem too. Except I added NextWeek: ‘dddd DD/MM/YYYY’

                    Cheers!

                    1 Reply Last reply Reply Quote 0
                    • M
                      mjtice @daikaiju last edited by

                      @daikaiju it’s on line 245 in the current release. Keep in mind that if you upgrade you’ll lose those changes (as I did exactly 2 days after I made that post…).

                      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