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

      displays the last row of the data-string, though the data from first to last are looped. for me it seems correct there …

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

        @Perlchamp ok, put a stop on the 1st line of getDom()

        it will be called before you get data, then your notification will be called
        and then getdom() again… and u can watch it go thru the code

        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

          yes it does … i changed innerText to innerHTML but nothing.

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

            @Perlchamp ok, inner HTML is when u are inserting html… my code inserts text…

            did u have a position: in config definition for module?

            		{
            			module: "SampleModule",
            			disabled: false, 
            			position: 'middle',
            			config: {
            				days_forward:4,
            			}
            		}
            

            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

              yes, top, but i will post it, moment:

              		{
              			module: 'perlchamp',
              			position: 'top',
              			header: "Geburtstage",
              			config: {
              				language: "de"
              			}
              
              
              S 1 Reply Last reply Reply Quote 0
              • S Do not disturb
                sdetweil @Perlchamp
                last edited by sdetweil

                @Perlchamp i changed mine to top and all ok, did u walk thru the code in getdom? (hit next over and over)

                put a stop on return wrapper and look at that object…

                i have multiple names on the same date in my csv file
                and also allowed look ahead a few days… so had entries for today and tuesday 5/5

                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 clicked on the linenumber and the blue sign went to the last line, though i couldn’t hit line for line …

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

                    @Perlchamp next to the blue arrow (to the right) is a half circle with arrow at the end and dot under… that is the “Next” instruction button

                    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

                      return wrapper. all entries undefined, aha.

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

                        @Perlchamp on entry, check that the this.active_birthdays is still good

                        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 cannot place the blue sign on line 118 (cklicking on that number => run to last line …)

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

                            @Perlchamp
                            Screenshot at 2020-05-01 22-19-58.png

                            see the circle net to the blue arrow

                            i don’t know where your 118 line is…
                            but go down or up

                            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

                              it loops from first entry to last. if the last entry is displayed, it loops once and than going to self.updateDom … for me the correct way …

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

                                @Perlchamp in the getDom()

                                does it do the innerText statement? then the addChild()

                                to get any text on the screen, it has to do every statement at least once

                                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

                                  how said:
                                  if i click on the linenumber of getDom: the blue arrow run to the last line. i can’t stop it or something else … it runs thru

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

                                    @Perlchamp i don’t understand

                                    in code view, scroll down to getDom, next line, click the number to the left, turns blue

                                    hit refresh

                                    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

                                      all values “undefined”

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

                                        @Perlchamp this.active_brithdays undefined?

                                        did u fix the names in the notification handler?

                                        		if(notification === "have data"){
                                        
                                        			var self = this
                                        			Log.log(this.name + " received a socket notification: " + notification + " - Payload: " + payload);
                                        			
                                        			var now = moment();
                                        			
                                        
                                        			for(var birthday of payload) {
                                        				// get 1st 5 chars of birthdate, thru month
                                        				// we will use this as the key in the hash
                                        				var birth_date = birthday.birth.substring(0,5);
                                        				
                                        				// get the birthday as a moment in this year, for comparing
                                        				var birth_date_moment = moment(birth_date + now.year(),"DD.MMYYYY");
                                        
                                        				// u can add days to a moment object and then compare 
                                        				//     if the birthdate is before that date (and after now)
                                        				//     so within the next xx days
                                        
                                        				// if the date is the same or later, don't use time of day
                                        				if(birth_date_moment.startOf('day').isSame(now.startOf('day'))) {
                                        
                                        					// birthday is in this month
                                        					// check the hash if we've seen anything for today yet
                                        					// if we haven't see this date yet
                                        					if(this.active_birthdays[birth_date] == undefined){
                                                   
                                        						//  create the holder for its info (array of 
                                        						//		names) in the hash
                                        						this.active_birthdays[birth_date] = [];
                                        					}
                                        					// save the persons name on the list
                                        					this.active_birthdays[birth_date].push(birthday.name);
                                        				}
                                        			}
                                             
                                        			// tell MM to call and get our content
                                        			self.updateDom();
                                        		}     			
                                        

                                        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

                                          picture

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

                                            @Perlchamp click on line number 122 for a stop… birthday is not defined once you leave the for loop…

                                            Sam

                                            How to add modules

                                            learning how to use browser developers window for css changes

                                            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
                                            • 5
                                            • 6
                                            • 7
                                            • 8
                                            • 9
                                            • 15
                                            • 16
                                            • 7 / 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