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 495.6k 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.
    • PerlchampP Offline
      Perlchamp
      last edited by

      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 Reply Quote 0
      • S Do not disturb
        sdetweil @Perlchamp
        last edited by

        @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
        • PerlchampP Offline
          Perlchamp
          last edited by

          done, it’s frozen now. must restart …

          1 Reply Last reply Reply Quote 0
          • PerlchampP Offline
            Perlchamp
            last edited by

            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 Reply Quote 0
            • S Do not disturb
              sdetweil @Perlchamp
              last edited by

              @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
              • PerlchampP Offline
                Perlchamp
                last edited by

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

                1 Reply Last reply Reply Quote 0
                • S Do not disturb
                  sdetweil
                  last edited by sdetweil

                  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
                  • PerlchampP Offline
                    Perlchamp
                    last edited by

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

                    S 1 Reply Last reply Reply Quote 0
                    • S Do not disturb
                      sdetweil @Perlchamp
                      last edited by

                      @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
                      • PerlchampP Offline
                        Perlchamp
                        last edited by

                        without i have a black screen, with everythings fine.
                        another information:
                        age must be +1 but i think i will solve this alone. if not i’m too stuipid for this all :-)
                        so i can create my table now. but i see:
                        people who has birthday the same day:
                        date should be displayed once, and the names in the same , separated by

                        S 1 Reply Last reply Reply Quote 0
                        • S Do not disturb
                          sdetweil @Perlchamp
                          last edited by sdetweil

                          @Perlchamp ok, I think you can fix those… age is a date diff()… add to results

                          edit: age needs more work that just number… because they were comparing MONTH, but age was exact days.

                          so I change my bd to may, but TODAY I am 68… in may i WILL BE 69 (in the future)
                          so if TODAY or before, do NOT add one, if tomorrow or after (in the month) add 1

                          Sam

                          How to add modules

                          learning how to use browser developers window for css changes

                          1 Reply Last reply Reply Quote 0
                          • PerlchampP Offline
                            Perlchamp
                            last edited by

                            i think, too. thanks very much, sam. I don’t know how to thank you Thank you very much !
                            you’re great !
                            and it is up to you whether you publish this module. I will not adorn myself with foreign feathers!

                            S 2 Replies Last reply Reply Quote 0
                            • S Do not disturb
                              sdetweil @Perlchamp
                              last edited by

                              @Perlchamp its not my module… its yours…

                              Sam

                              How to add modules

                              learning how to use browser developers window for css changes

                              1 Reply Last reply Reply Quote 0
                              • S Do not disturb
                                sdetweil @Perlchamp
                                last edited by

                                @Perlchamp see how interesting ‘just a birthday list’ can be! and u still have styles to apply etc

                                Sam

                                How to add modules

                                learning how to use browser developers window for css changes

                                1 Reply Last reply Reply Quote 0
                                • PerlchampP Offline
                                  Perlchamp
                                  last edited by Perlchamp

                                  I do not think so. I could never answer questions about any problems …
                                  i did:

                                  ... age='+(person.age + 1);
                                  

                                  the styles you could get from me, no problem. it’s just fair, isn’t it ?

                                  S 1 Reply Last reply Reply Quote 0
                                  • S Do not disturb
                                    sdetweil @Perlchamp
                                    last edited by

                                    @Perlchamp should be wrong for people with birthday yesterday

                                    Sam

                                    How to add modules

                                    learning how to use browser developers window for css changes

                                    1 Reply Last reply Reply Quote 0
                                    • PerlchampP Offline
                                      Perlchamp
                                      last edited by Perlchamp

                                      ah, oooook … hm. shooted to fast. but let me figured out by myself, cause i don’t wonna feel like a baby … i think if-statements and moment() could be helpfully.

                                      1 Reply Last reply Reply Quote 0
                                      • PerlchampP Offline
                                        Perlchamp
                                        last edited by Perlchamp

                                        general question:
                                        is there something like “print”? (for debugging) or have i use innerText or innerHTML or Log.log ? … to display something on screen ?

                                        S 1 Reply Last reply Reply Quote 0
                                        • S Do not disturb
                                          sdetweil @Perlchamp
                                          last edited by

                                          @Perlchamp Log.log only

                                          did u see my chat message about fixing a bug in the MMM-Logging module

                                          Sam

                                          How to add modules

                                          learning how to use browser developers window for css changes

                                          1 Reply Last reply Reply Quote 0
                                          • PerlchampP Offline
                                            Perlchamp
                                            last edited by

                                            i will have a look on it, though MERCI !

                                            S 1 Reply Last reply Reply Quote 0

                                            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                                            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                                            With your input, this post could be even better 💗

                                            Register Login
                                            • 1
                                            • 2
                                            • 7
                                            • 8
                                            • 9
                                            • 10
                                            • 11
                                            • 15
                                            • 16
                                            • 9 / 16
                                            • 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