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.

    A module that changes the text color of a Calender when the next event happens in a certain amount of time.

    Scheduled Pinned Locked Moved Unsolved Feature Requests
    11 Posts 2 Posters 2.7k Views 2 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
      MerlijnAlmer
      last edited by

      A module that changes the text color of a Calender when the next event happens in a certain amount of time.

      before i made this i asked if it is even possible people said yes but now i would like to see it happen.
      the only issue for me is the fact that i am really bad at programming i wouldn’t even know where to start.

      but the purpose of this would be that if there is 5 minutes left till a event the text would turn red. or something like that.

      could somebody help me with making it or by makking it i would appreciate it really much.

      Kind regards,
      ~M

      ? 1 Reply Last reply Reply Quote 0
      • ? Offline
        A Former User @MerlijnAlmer
        last edited by

        @MerlijnAlmer

        Like this?
        0_1569227265077_94237994-4388-41fd-9bf7-18aea7d35bcb-image.png
        MMM-CalendarExt2 has transform feature so a user can change attributes of events by conditions. Above example shows the transforming of icon and class of events.

        ...
                  {
                    name: "VIEW3",
                    mode: "upcoming",
                    position:"top_center",
                    transform:(event) => {
                      if (event.startDate < ((Date.now()/1000 + 60*60*4))) {
                        event.className = "urgent"
                        event.icon = "flat-color-icons:alarm-clock"
                        event.title = "[URGENT] " + event.title
                      }
                      return event
                    }
                  },
        ...
        
        1 Reply Last reply Reply Quote 0
        • M Offline
          MerlijnAlmer
          last edited by MerlijnAlmer

          yes thank you @Sean thats exactly what i mean.

          ~M

          1 Reply Last reply Reply Quote 0
          • M Offline
            MerlijnAlmer
            last edited by

            @Sean you wouldn’t happen to know a way to have the description of a event be displayed instead of the organizer?

            I am using the magic mirror framework for a roommanagement system for the company i work for and they use a Office calendar to manage the room but now it shows who reserved the room and not the reason why.

            ? 1 Reply Last reply Reply Quote 0
            • ? Offline
              A Former User @MerlijnAlmer
              last edited by

              @MerlijnAlmer
              Do you mean showing Description or Location of event?
              0_1569235515752_4febf88f-bfbb-4913-bf8b-149dd78ae0c7-image.png

              1 Reply Last reply Reply Quote 0
              • M Offline
                MerlijnAlmer
                last edited by

                yes just showing the discrition of a event.

                they make an event for that day and in the description part they fill in what they need the room for.
                so instead of seeing thier names on the screen they would like to see the description.
                location is not needed seen as the screens are at the room.

                thanks for all your help BTW.

                ~M

                ? 1 Reply Last reply Reply Quote 0
                • ? Offline
                  A Former User @MerlijnAlmer
                  last edited by

                  @MerlijnAlmer
                  If you are using MMM-CalendarExt2, you can transform title of an event by replacing with description field of event.
                  0_1569235896047_6b16e36a-ae34-45b5-b861-0d15007aebfa-image.png

                  views: [
                    ...
                    {
                      name: "VIEW3",
                      mode: "upcoming",
                      position:"top_center",
                      transform:(event) => {
                        event.title = event.description
                        if (event.startDate < ((Date.now()/1000 + 60*15))) {
                          event.className = "urgent"
                          event.icon = "flat-color-icons:alarm-clock"
                        }
                        return event
                      }
                    },
                    ...
                  ]
                  

                  :D

                  1 Reply Last reply Reply Quote 0
                  • M Offline
                    MerlijnAlmer
                    last edited by

                    okay i was just in the process of taking the screen apart to use calendarExt2 thank you for your quick and usefull help.

                    ~M

                    1 Reply Last reply Reply Quote 0
                    • M Offline
                      MerlijnAlmer
                      last edited by

                      @Sean i might seem to be a absolute knob head for you but when i put the codes in my .js file it breaks the file.
                      or is the code supposed to go in to the .css file?

                      ? 1 Reply Last reply Reply Quote 0
                      • ? Offline
                        A Former User @MerlijnAlmer
                        last edited by

                        @MerlijnAlmer
                        show me your configuration. eouia0819@gmail.com

                        1 Reply Last reply Reply Quote 0
                        • 1
                        • 2
                        • 1 / 2
                        • 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