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

Absolute date

Scheduled Pinned Locked Moved Troubleshooting
9 Posts 4 Posters 5.0k 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.
  • D Offline
    deadherring
    last edited by Oct 31, 2016, 1:16 AM

    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 Nov 1, 2016, 5:30 PM Reply Quote 0
    • D Offline
      deadherring @deadherring
      last edited by Nov 1, 2016, 5:30 PM

      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 Offline
        mjtice
        last edited by Dec 12, 2016, 1:51 AM

        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 Offline
          mjtice
          last edited by Dec 15, 2016, 3:40 AM

          … and by
          {
          timeFormat: ‘relative’
          }

          I mean
          {
          timeFormat: ‘absolute’
          }
          ugh.

          1 Reply Last reply Reply Quote 0
          • M Offline
            mjtice
            last edited by Dec 15, 2016, 11:01 PM

            This post is deleted!
            1 Reply Last reply Reply Quote 0
            • M Offline
              mjtice
              last edited by Dec 17, 2016, 2:15 PM

              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 Apr 5, 2017, 3:21 PM Reply Quote 0
              • D Offline
                daikaiju @mjtice
                last edited by Apr 5, 2017, 3:21 PM

                @mjtice What lines did you implement that code on?

                M 1 Reply Last reply Apr 13, 2017, 1:52 AM Reply Quote 0
                • D Offline
                  DeanoAus @mjtice
                  last edited by Apr 12, 2017, 5:37 AM

                  @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 Offline
                    mjtice @daikaiju
                    last edited by Apr 13, 2017, 1:52 AM

                    @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 Sam, technical setup by Karsten.
                    This forum is using NodeBB as its core | Contributors
                    Contact | Privacy Policy