From 200079acd6cf16ec09f43b042c4b97f401a74ec9 Mon Sep 17 00:00:00 2001 From: Michael Prager Date: Wed, 13 Oct 2010 02:34:26 +0200 Subject: [PATCH] fixed calendar events showing as "undefined" on N8 --- comingNext/index.html | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/comingNext/index.html b/comingNext/index.html index 459441c..7f974d8 100644 --- a/comingNext/index.html +++ b/comingNext/index.html @@ -87,6 +87,19 @@ var daylightsavingWinter = 0; var daylightsavingSummer = 0; var summertime = false; +// this is a list of data fields a calendar event can have +var entryFields = [ + "id", + "Type", + "Summary", + "Location", + "Status", + "StartTime", + "EndTime", + "InstanceStartTime", + "InstanceEndTime" +]; + window.onload = init; window.onresize = updateScreen; window.onshow = updateScreen; @@ -1203,13 +1216,21 @@ function listCalendars() } } +// Copies all objects and their properties to an array. Data is copied so nothing gets lost when the reference is removed function listToArray(list) { - var array = []; + var array = new Array(); var item; + var txt = ""; while (( item = list.getNext()) != undefined ) { - array.push(item); + var itemCopy = new Object(); + for(var i=0; i < entryFields.length; i++) { + itemCopy[entryFields[i]] = item[entryFields[i]]; + } + array.push(itemCopy); + txt += array[array.length - 1].Summary + ", "; } + console.info("listToArray(): " + txt); return array; } -- 2.39.2