Hello,

I've tried looking for a solution but unable to find one, if you know
of a pre-posted solution I would be glad to take a link.

I'm trying to retrieve 7 days worth of events (2 events, each
recurring weekly) from my publicly shared calendar. So far I have been
able to find this code:

-snip-
                var startDateTime = new google.gdata.DateTime(getSundayDate());
                startDateTime.setDateOnly = true;
                var service = new 
google.gdata.calendar.CalendarService('gdata-js-
client-samples-simple');
                var query = new google.gdata.calendar.CalendarEventQuery
(calendarUrl);
                query.setOrderBy('starttime');
                query.setSortOrder('ascending');
                alert(startDateTime.getDate());
                query.setMinimumStartTime(startDateTime);
                query.setFutureEvents(false);
                query.setSingleEvents(false);
                query.setMaxResults(7);
-/snip-

this is the code for the getSundayDate, however the alerts show that
the date it returns is correct:

-snip-
        function getSunday() {
                today = new Date();
                // Get the day of the week for today
                thisDay = today.getDay();
                // Get Sundays date by subtracting the
                // current day of the week from todays date
                sunDay = today.getDate() - thisDay;
                return sunDay;
        }

        function getSundayDate() {
                today = new Date();
                return today.getFullYear() + "-" + (today.getMonth() + 1) + "-" 
+
getSunday();
        }
-/snip-

This code when I take out the query.setMinimumStartTime retrieves the
first 7 days of the events, from the first date they were added. When
I add the setMinimumStartTime it doesn't show anything. Am I
misunderstanding the methods for the CalendarService object? Any
suggestions are greatly welcome.

--~--~---------~--~----~------------~-------~--~----~
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://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to