Read the statement by Michael Teeuw here.
read csv-data and put it in an array
-
@Perlchamp i don’t understand
in code view, scroll down to getDom, next line, click the number to the left, turns blue
hit refresh
-
all values “undefined”
-
@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(); }
-
-
@Perlchamp click on line number 122 for a stop… birthday is not defined once you leave the for loop…
-
yes i did. all variables are correct
-
@Perlchamp and getDom() will be called multiple times, once before your data arrives, maybe once more than when you data is ready
and it does the innerText statement?
and u look at the element, and look at the inner text and its correct?
i am running out of energy for the day… been since 6am. now 11pm
-
122 => next => marks “return”(131) => next => marks end of 131 => next => jumped to main.js
-
@Perlchamp mark the line for the second for(
for(var birthday of Object.keys(this.active_birthdays)){ for(var name of this.active_birthdays[birthday]){ // stop on this line
and remove the other stops
-
the same see picture i did send to you. it’s line 122 => stop => refresh => and than like posted before
no does nothing … ok never mind. coming from germany it’s now 06:00 in the morning did’t sleep …