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

read csv-data and put it in an array

Scheduled Pinned Locked Moved Utilities
313 Posts 3 Posters 407.7k 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.
  • S Offline
    sdetweil @Perlchamp
    last edited by May 2, 2020, 4:44 PM

    @Perlchamp said in read csv-data and put it in an array:

      		if(birth_date_moment.startOf('day').isSameOrAfter(now.startOf('day')) &&
         	  birth_date_moment.startOf('day').isSameOrBefore(birthday_time_window.startOf('day'))) {
    

    yes it only shows for today+some possible offset… I said u had to fix that to do month comparison

    Sam

    How to add modules

    learning how to use browser developers window for css changes

    1 Reply Last reply Reply Quote 0
    • P Offline
      Perlchamp
      last edited by May 2, 2020, 4:54 PM

      shame on me, sorry for that. now it’s changed to:

      if(birth_date_moment.startOf('month').isSameOrAfter(now.startOf('month')) &&
      					birth_date_moment.startOf('month').isSameOrBefore(birthday_time_window.startOf('month'))) {
      

      nothing changed, i have configured the terminal-window to scroll about 3000 (!) lines, but can’t see the beginning …
      image

      S 1 Reply Last reply May 2, 2020, 4:58 PM Reply Quote 0
      • S Offline
        sdetweil @Perlchamp
        last edited by May 2, 2020, 4:58 PM

        @Perlchamp redirect the terminal window to a file and edit that

        do this in the code

        				// if the date is the same or later, don't use time of day
        			 	//if(birth_date_moment.startOf('day').isSameOrAfter(now.startOf('day')) &&
                                        //  birth_date_moment.startOf('day').isSameOrBefore(birthday_time_window.startOf('day'))) {
        			   	*/
        			   	if( birth_date_moment.month() == now.month() ){
        

        Sam

        How to add modules

        learning how to use browser developers window for css changes

        1 Reply Last reply Reply Quote 0
        • P Offline
          Perlchamp
          last edited by May 2, 2020, 5:07 PM

          done, it’s frozen now. must restart …

          1 Reply Last reply Reply Quote 0
          • P Offline
            Perlchamp
            last edited by May 2, 2020, 5:10 PM

            question:
            in the

            socketNotificationReceived: function(notification, payload) {
            		if(notification === "HAVEDATA") {
            			var self = this;
                           ...
            

            payload should be the variable in which the jsonString is saved ?

            S 1 Reply Last reply May 2, 2020, 5:14 PM Reply Quote 0
            • S Offline
              sdetweil @Perlchamp
              last edited by May 2, 2020, 5:14 PM

              @Perlchamp it has the jsonObj from the node_helper

              u can call it anything, its just a name

              so, if you put a stop right on the var self = this
              and then cursor over the work payload in

              function(notification, payload)
              

              it will show you that object content, and u can go up and click on parts to make them expand to examine the contents

              Screenshot at 2020-05-02 12-14-08.png

              Sam

              How to add modules

              learning how to use browser developers window for css changes

              1 Reply Last reply Reply Quote 0
              • P Offline
                Perlchamp
                last edited by May 2, 2020, 5:25 PM

                ok, there is a light at the end of the tunnel:
                image

                1 Reply Last reply Reply Quote 0
                • S Offline
                  sdetweil
                  last edited by sdetweil May 2, 2020, 5:36 PM May 2, 2020, 5:29 PM

                  code was changed to add ages

                  in getDom()

                  			for(var name of this.active_birthdays[birthday]) {
                  				var m = document.createElement("div");
                  				Log.log("BIRTHDAY >> " + birthday);
                  				Log.log("NAME >> " + name);
                  				m.innerText = birthday + " " + name;
                  				wrapper.appendChild(m);
                  			}
                  

                  now is

                  			for(var person of this.active_birthdays[birthday]){
                  				var m=document.createElement('div')
                  // create your table row here				
                  				m.innerText=birthday+ ' '+ person.name+' age='+person.age
                  				wrapper.appendChild(m)					
                  			}
                  

                  Sam

                  How to add modules

                  learning how to use browser developers window for css changes

                  1 Reply Last reply Reply Quote 0
                  • P Offline
                    Perlchamp
                    last edited by May 2, 2020, 5:36 PM

                    great, thanks !
                    to your information:
                    there are NO semikolons in your posted code. within them it goes !

                    S 1 Reply Last reply May 2, 2020, 5:37 PM Reply Quote 0
                    • S Offline
                      sdetweil @Perlchamp
                      last edited by May 2, 2020, 5:37 PM

                      @Perlchamp end of line ; are not required… I cut/pasted that code out of the running module

                      Sam

                      How to add modules

                      learning how to use browser developers window for css changes

                      1 Reply Last reply Reply Quote 0
                      • 1
                      • 2
                      • 16
                      • 17
                      • 18
                      • 19
                      • 20
                      • 31
                      • 32
                      • 18 / 32
                      18 / 32
                      • First post
                        172/313
                        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