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

Monthly Calendar View

Scheduled Pinned Locked Moved Solved Requests
58 Posts 23 Posters 76.5k Views 19 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.
  • K Offline
    KirAsh4 Moderator
    last edited by KirAsh4 Jun 1, 2016, 6:52 PM Jun 1, 2016, 6:51 PM

    I reverted to much simpler times. One of the things that irked me is that I’m displaying a month/year on the calendar when it’s displayed right above it in the clock module. So, I made it optional. One can choose to turn off the header or leave it on. For those of you who don’t display the clock (or who put it elsewhere), it’s helpful to leave the header on, but if you have the clock enabled, there’s no sense in adding the month and year right below it again. This trims the header and keeps a clean interface.

    0_1464806325661_calheader.png

    And I left the ability for the end user to create a custom CSS file and modify the look (I turned the header back on for this preview):

    0_1464806602032_calcolor_003.png

    In the above example, the custom CSS added a bullet point in between the month and year (which does not exist in the default CSS), made the year digits brighter, and colorized the current day. There are several nested elements that will allow the user to customize how they want their calendar to look. I’m looking at you guys who also have a colorized version of the weather module. :)

    A Life? Cool! Where can I download one of those from?

    1 Reply Last reply Reply Quote 0
    • F Offline
      flooo
      last edited by Jun 1, 2016, 7:58 PM

      I really like that touch of green in there…
      Well done!

      1 Reply Last reply Reply Quote 0
      • K Offline
        KirAsh4 Moderator
        last edited by Jun 1, 2016, 8:04 PM

        That’s the custom CSS being implemented. By default it doesn’t have any color nor border. The user can edit their CSS and personalize it that way. Essentially the code reads:

        	// Module defaults
        	defaults: {
        		...
        		displayMonthyear: true,
        		cssStyle: "default" /* Current options are 'default', 'block', 'custom' */
        	},
        
        	// Required styles
        	getStyles: function() {
        		switch(this.config.cssStyle) {
        			case "block":
        				return ["styleDefault.css", "styleBlock.css"];
        				break;
        			case "custom":
        				return ["styleDefault.css", "styleCustom.css"];
        				break;
        			default:
        				return ["styleDefault.css"];
        		}
        	},
        

        A Life? Cool! Where can I download one of those from?

        1 Reply Last reply Reply Quote 2
        • K Offline
          KirAsh4 Moderator
          last edited by Jun 2, 2016, 6:18 PM

          So as it turns out, it’s extremely easy to let the calendar Do Its Own Thing as far as figuring out what day to start the week on, Sunday or Monday. It litereally done by the system’s LOCALE, which you control by setting a language option in the main 'config.js'. Below is a screen shot of the English ('en') versus Spanish ('es') setting:

          0_1464890163157_caldates.png

          Notice how the Spanish one starts on Monday (lunes) whereas the English one starts on Sunday. I am not manually calculating this to draw the calendar. Moment.js takes care of this automatically.

          Here’s the drawback: if your LOCALE defines the start of the week as Sunday, but you want to VISUALLY set the calendar to Monday (or vice verse), that would require me to actually manually calculate the entire calendar and draw it out. It’s a pain in the rear to be honest.

          A Life? Cool! Where can I download one of those from?

          1 Reply Last reply Reply Quote 0
          • M Offline
            MichMich Admin
            last edited by Jun 4, 2016, 6:36 PM

            A bit late to the party thanks to a delightful holiday, but I must say: nice work on the calendar.
            One small suggestion: change the green color to an inverted black and white digit. I prefer the MM to be fully B&W.

            K 1 Reply Last reply Jun 4, 2016, 7:29 PM Reply Quote 0
            • K Offline
              KirAsh4 Moderator @MichMich
              last edited by Jun 4, 2016, 7:29 PM

              @MichMich, it is, by default, B/W. Users can set a custom CSS to change the colors, like I did as a test.

              A Life? Cool! Where can I download one of those from?

              M 1 Reply Last reply Jun 4, 2016, 7:30 PM Reply Quote 1
              • M Offline
                MichMich Admin @KirAsh4
                last edited by Jun 4, 2016, 7:30 PM

                @KirAsh4 Nice work!

                1 Reply Last reply Reply Quote 0
                • K Offline
                  KirAsh4 Moderator
                  last edited by Jun 5, 2016, 4:30 AM

                  I can spend days coming up with style ideas, but I think I’m done fiddling with this. It’s time to move on to the next step in the process. I’m cleaning up the branches on GitHub and getting ready to open the flood gates. In the mean time, here’s the 4 styles that I’m including. Note that the ‘slate’ style is really meant for people who have a mirror-less display as the colors probably won’t show very well through a 2-way mirror.

                  • The calendar is language aware, meaning it will translate to your language setting.
                  • The calendar will automatically start on either Monday or Sunday depending on your language setting.
                  • The header (month and year) can be suppressed (not shown) if desired.
                  • Customization can be done through the custom CSS file
                  • Current day is highlighted through CSS styling.
                  • Probably more stuff I forget at the moment … I’ll have it all written out in the README file, including the full styling tree.

                  0_1465100367184_calStyles.png

                  A Life? Cool! Where can I download one of those from?

                  1 Reply Last reply Reply Quote 1
                  • M Offline
                    MichMich Admin
                    last edited by Jun 5, 2016, 7:34 AM

                    Could you try a version where the active day is black text on a white background? So a little white square with a black number in it? Preferably with rounded corners. (Radius 1 or 2).

                    1 Reply Last reply Reply Quote 0
                    • K Offline
                      KirAsh4 Moderator
                      last edited by KirAsh4 Jun 5, 2016, 6:20 PM Jun 5, 2016, 4:41 PM

                      Oh I suppose …
                      0_1465144698937_block.png

                      Keep in mind that the styling can be changed by the user to whatever they want it to look like. The sky isn’t the limit … it’s their imagination. :)

                      A Life? Cool! Where can I download one of those from?

                      M K 2 Replies Last reply Jun 5, 2016, 6:40 PM Reply Quote 0
                      • 1
                      • 2
                      • 3
                      • 4
                      • 5
                      • 6
                      • 3 / 6
                      3 / 6
                      • First post
                        21/58
                        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