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

MMM-CalendarExt3

Scheduled Pinned Locked Moved Utilities
642 Posts 77 Posters 1.7m Views 81 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.
  • M Offline
    MMRIZE
    last edited by MMRIZE Apr 24, 2022, 8:21 PM Apr 24, 2022, 7:18 PM

    MMM-CalendarExt3

    New MagicMirror module for calendar view. (successor of MMM-CalendarExt2)

    Screenshot

    screenshot

    Concept

    My previous module, MMM-CalendarExt2, was always notorious for its difficulty to use. I need a more easy and light one. So I rewrite this from scratch newly.

    Features

    What’s different with CX2.

    • Only focusing on how it shows; Parsing is delegated to original MagicMirror module calendar. (It means the calendar module is REQUIRED to use this module.)
    • Only week and month views. I found that people are rarely interested in other views on CX2. So I drop out different views.
    • Respect to original MM’s hide/show mechanism. Now you can hide/show this module easily with other scheduler or control modules. (By the way, Look at this module also. - MMM-Scenes)
    • No dependency on the 3rd party modules (e.g. momentJS or Luxon, etc.). This is built with pure JS and CSS only.

    Main Features

    • week view or month view
    • locale-aware calendar
    • customizing events: filtering, sorting, transforming
    • multi-instance available. You don’t need to copy and rename the module. Just add one more configuration in your config.js.

    DETAILS : https://github.com/MMRIZE/MMM-CalendarExt3

    L B D B N 5 Replies Last reply Apr 25, 2022, 9:28 PM Reply Quote 3
    • L Offline
      luisestrada @MMRIZE
      last edited by Apr 25, 2022, 9:28 PM

      @MMRIZE It took me a while to understand how to show the calendar module without the events module, it was just by not adding the position and worked like a charm :)

      Thank you :), great module

      L 1 Reply Last reply Apr 29, 2022, 12:23 AM Reply Quote 0
      • H Offline
        hrmax
        last edited by Apr 27, 2022, 2:47 AM

        Great work @MMRIZE ! I like how this calendar looks much better.

        I am having an issue with the eventTransformer though. I can’t seem to get it to update any of the event properties.

        Is it possible to use the same symbols/icons as set in the calendar module?

        H 1 Reply Last reply Apr 27, 2022, 5:29 AM Reply Quote 0
        • H Offline
          hrmax @hrmax
          last edited by Apr 27, 2022, 5:29 AM

          {
             module: "MMM-CalendarExt3",
             position: "bottom_center",
             title: "",
             config: {
               mode: "month",
               instanceId: "basicCalendar",
               minimalDaysOfNewYear: 1,
               maxEventLines: 5,
               firstDayOfWeek: 0,
               eventFilter: (ev) => {
                 if (ev.title.isFullday) return false
                 return true
               },
               eventTransformer: (ev) => {
                   if (ev.title.search('a') > -1)  ev.title = 'test'
                   return event
               },
          }
          
          M 1 Reply Last reply Apr 27, 2022, 6:51 AM Reply Quote 0
          • M Offline
            MMRIZE @hrmax
            last edited by MMRIZE Apr 27, 2022, 6:55 AM Apr 27, 2022, 6:51 AM

            @hrmax
            First, Thanks for the feedback. I found there was some mistype in code. I fixed it, so update with git pull.

            Second, for eventFilter

            eventFilter: (ev) => {
              if (ev.isFullday) return false
              return true
            },
            

            Third, for eventTransformer and symbol example.

            eventTransformer: (ev) => {
              ev.title = `<i class="fa fa-${ev.symbol}"></i>${ev.title}`
              return ev
            },
            

            Result;
            4f66a6de-633f-4cca-a921-1c0ce47e23b5-image.png

            H 1 Reply Last reply Apr 28, 2022, 3:49 AM Reply Quote 0
            • H Offline
              hrmax @MMRIZE
              last edited by Apr 28, 2022, 3:49 AM

              @MMRIZE This was super helpful, thank you! It resolved the issues I was having.

              I ended up modifying MMM-CalendarExt3.js so that I could better control the time format. Since I’m using this in portrait mode, I don’t much space so for time values I wanted

              4:00 PM -> 4
              5:30 PM -> 5:30
              
              M 1 Reply Last reply Apr 28, 2022, 9:01 AM Reply Quote 0
              • M Offline
                MMRIZE @hrmax
                last edited by Apr 28, 2022, 9:01 AM

                @hrmax

                You can adjust eventTimeOptions to format the time or date of the event.
                But not by condition.

                eventTimeOptions: {
                  hour: "numeric",
                }
                

                will show only hour like 4

                or

                eventTimeOptions: {
                  hour: "numeric",
                  minute : "2-digit"
                }
                

                will show the hour and minute like 4:05

                or

                eventTimeOptions: {
                  timeStyle: "short"
                }
                

                will show standard locale format like 4:05 am. (It depends on which locale is applied.)

                But not conditionally. (4 or 4:05 by condition)

                One possible idea is;
                Hide the real time parts with CSS, then transform event title to include time;

                /* In your custom.css */
                .CX3 .myTime {
                  font-size: 80%;
                  color: #999;
                  font-weight: normal;
                }
                
                .CX3 .event:not(.fullday) .eventTime {
                  display: none;
                }
                
                /* In your config */
                eventTransformer: (ev) => {
                  if (!ev.isFullday) {
                    let t = new Date(ev.startDate)
                    let time = (t.getMinutes() === 0) ? String(t.getHours()) : String(t.getHours() + ':' + t.getMinutes())
                    ev.title = `<span class="myTime">${time}</span> ${ev.title}`	
                  }
                  return ev 
                }
                

                The result will be;

                3f2e6599-cf2b-4c94-a064-3704e4ad72bd-image.png

                H W D 3 Replies Last reply Apr 28, 2022, 3:12 PM Reply Quote 0
                • H Offline
                  hrmax23 @MMRIZE
                  last edited by Apr 28, 2022, 3:12 PM

                  @MMRIZE

                  This is a much more elegant solution than what I came up with. Many thanks!

                  1 Reply Last reply Reply Quote 0
                  • A Offline
                    Assassins
                    last edited by Apr 28, 2022, 4:08 PM

                    Will it be possible to pull out the birthday that is associated with a contact person from icloud. ???

                    M 1 Reply Last reply Apr 29, 2022, 7:43 AM Reply Quote 0
                    • L Offline
                      luisestrada @luisestrada
                      last edited by Apr 29, 2022, 12:23 AM

                      @MMRIZE , just a note. I also use the browser to open the mirror and works in all platforms I’ve tested except one, Tizen browser (Samsung TVs). All modules work but this, no idea what happens but probably any form of javascript may not be supported by Tizen.

                      I’m quite happy with the module though

                      M 1 Reply Last reply Apr 29, 2022, 7:50 AM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 64
                      • 65
                      • 1 / 65
                      1 / 65
                      • First post
                        4/642
                        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