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.

    Calendar Module - interaction - scrollable - different start dates

    Scheduled Pinned Locked Moved Unsolved Requests
    2 Posts 1 Posters 1.6k Views 1 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.
    • A Offline
      AxLed Module Developer
      last edited by

      Hi to all MM-Builders,

      as i want to use my MM as replacement for a analog family cardboard calendar i have following question/request.

      Is there calendar module, where i can “scroll” throuh the dates?
      As i have a rotary encoder connected to my pi 3 - sending of notifications is no problem.
      Something like “+7” or “-7” (days).

      I checked the default calendar module and guess i have to add “notification received”, but i dont understand, how the module reads an .ics file.

      Is it possible to set a start date, from which the calender entries should be shown?
      So i could manipulate the startdate by notifications from my rotary module (MMM-Navigate).

      Maybe someone has a tip where i can start.

      Thanks in advance.

      AxLED

      1 Reply Last reply Reply Quote 0
      • A Offline
        AxLed Module Developer
        last edited by AxLed

        Hi to all,

        i checked the default calendar module and found an approach:
        If i manipulate following code:
        calendar.js, Line 338:
        var today = moment().startOf("day");’ to var today = moment().subtract(60,'d').startOf("day");

        and

        calendarfetcher.js, Line 74:
        var today = moment().startOf("day").toDate(); to var today = moment().subtract(60,'d').startOf("day").toDate();

        the calendar module of my MM will show calendar entries starting Date of two month ago (today-60 days).

        Now i have to add following functions:

        • notification received function for ±5 days (for example)
        • manipulate variable today with value of notification received
        • pass variable today to the right place in code of calender.js and calendarfetcher.js
        • refresh module after receiving notification
        • stop sending notification from calendar to other modules, in case variable today is manipulated

        Sources: https://momentjs.com/docs/#/manipulating/add/

        Greets

        AxLED

        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