]> code.delx.au - comingnext/commitdiff
fixed calendar events showing as "undefined" on N8
authorMichael Prager <michael@pragers.de>
Wed, 13 Oct 2010 00:34:26 +0000 (02:34 +0200)
committerMichael Prager <michael@pragers.de>
Wed, 13 Oct 2010 00:34:26 +0000 (02:34 +0200)
comingNext/index.html

index 459441c5f3d64b5094669b5cc95f6b8886739ea9..7f974d8c451e23a3f2018101e66659d192be1c25 100644 (file)
@@ -87,6 +87,19 @@ var daylightsavingWinter = 0;
 var daylightsavingSummer = 0;\r
 var summertime = false;\r
 \r
+// this is a list of data fields a calendar event can have\r
+var entryFields = [\r
+       "id",\r
+       "Type",\r
+       "Summary",\r
+       "Location",\r
+       "Status",\r
+       "StartTime",\r
+       "EndTime",\r
+       "InstanceStartTime",\r
+       "InstanceEndTime"\r
+];\r
+\r
 window.onload = init;\r
 window.onresize = updateScreen;\r
 window.onshow = updateScreen;\r
@@ -1203,13 +1216,21 @@ function listCalendars()
        }\r
 }\r
 \r
+// Copies all objects and their properties to an array. Data is copied so nothing gets lost when the reference is removed\r
 function listToArray(list)\r
 {\r
-       var array = [];\r
+       var array = new Array();\r
        var item;\r
+       var txt = "";\r
        while (( item = list.getNext()) != undefined ) {\r
-               array.push(item);\r
+               var itemCopy = new Object();\r
+               for(var i=0; i < entryFields.length; i++) {\r
+                       itemCopy[entryFields[i]] = item[entryFields[i]];\r
+               }\r
+               array.push(itemCopy);\r
+               txt += array[array.length - 1].Summary + ", ";\r
        }\r
+       console.info("listToArray(): " + txt);\r
        return array;\r
 }\r
 \r