We list our daily opening/closing hours on a Google Calendar as Events. After some struggles with the Javascript API, we are almost able to extract the hours (events) for today and for tomorrow to embed elsewhere on the site -- but at 7pm local time (EST in the US) it kicks over to the next days' listings.
That seems to be 0:00 GMT, when it switches, yet the calendar itself displays as it should for our time zone. For some reason I'm too dumb to find, the script is pulling the events in a way that almost does does but doesn't quite correspond with the calendar.
Any ideas on how to solve this? (I'm open to even inelegant workarounds.)
Not sure, but suspect the relevant script chunk is below:
/* loop through each event in the feed */
var len = entries.length;
for (var i = 0; i < len; i++) {
var entry = entries[i];
var title = entry.getTitle().getText();
var startDateTime = null;
var startJSDate = null;
var times = entry.getTimes();
if (times.length > 0) {
startDateTime = times[0].getStartTime();
startJSDate = startDateTime.getDate();
}
var dateString = (startJSDate.getMonth() + 1) + "/" + startJSDate.getDate();
if (!startDateTime.isDateOnly()) {
dateString += " " + startJSDate.getHours() + ":" +
padNumber(startJSDate.getMinutes());
}
Thanks very much--
2
Contributors
3
Replies
1 Day
Discussion Span
3 Months Ago
Last Updated
9
Views
Related Article:google login api javascript reauthorization
is a JavaScript / DHTML / AJAX discussion thread by javalover that has 1 reply, was last updated 2 months ago and has been tagged with the keywords: google, login, api, reauthorization.
We are pulling the events. What we don't understand is how to fix the 5-hour offset.
If user sees the event we pull right now (Sunday at half-past six in the morning) it's fine, it shows our hours for Sunday. Same deal at noon. And at 4pm, and so on--up until 7pm, when it will instead show the hours for Monday.
If user sees the event we pull right now (Sunday at half-past six in the morning) it's fine, it shows our hours for Sunday. Same deal at noon. And at 4pm, and so on--up until 7pm, when it will instead show the hours for Monday.
This is issue you are having is more related to the server: