hi!
what i am doing is call a google-spreadsheet script, which gets a date-value
from a cell and based on this date creates an event in my calendar. the
problem is, that the date in the calendar is 2 days early, and i dont know
why. of couser i already did some research and obviously this problem is not
new.
here is what i have checked so far:
- i checked and corrected the timezones of the script itself, the
spreadsheet-file, the calendar:
- script timezone: GMT +01:00 Berlin
- spreadsheet timezone: GMT +01:00 Berlin
- calendar timezone: GMT+01:00) Wien
- the date-values in the cells look like this: "18/03/2011" and the whole
column containing the dates is formated as a Date
- keep in mind the following for the example in the code:
- cell value is: 26/08/2011
- logger output-value is: Thu Aug 25 15:00:00 PDT 2011
- and the actual date written to the calendar is on 24/08/2011
my code looks like this:
function caltest1() {
var sheet = SpreadsheetApp.getActiveSheet();
var startRow = 200; // First row of data to process
var numRows = 100; // Number of rows to process
var dataRange = sheet.getRange(startRow, 1, numRows, 34);
var data = dataRange.getValues();
*var cal = CalendarApp.openByName("PW");*
for (i in data) {
var row = data[i];
var title = row[1] + " @ " + row[3]; // First column
var desc = row[31]; // Second column
* var date = row[0];*
Logger.log(date); *//Logger Output here is: "Thu Aug 25 15:00:00 PDT
2011" BUT the actual value in the cell is "26/08/2011"*
var loc = row[2];
var added = row[33];
if (added == "x") {
cal.createAllDayEvent(title, date, {description:desc, location:loc});
var v = parseInt(i); // +2 is an offset to do with the numbering of
rows and the "blank" header row 0;
sheet.getRange(v+startRow, 34, 1, 1).setValue("Added"); //set the fact
that we have updated the calendars for this
}
}
}
what am i doing wrong??
thank you!
Peter
--
You received this message because you are subscribed to the Google
Groups "Google Calendar Data API" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://code.google.com/apis/calendar/community/forum.html