I have a C# sample app, calendar.cs in samples, that goes over the feed, get's all the startdates, and creates an array of dates to put into the calendarcontrol (bolded dates). Below code tries to do the same?

Here is the C# snippet.

             ArrayList dates = new ArrayList(50);
            EventQuery query = new EventQuery();
            CalendarService service = new CalendarService("CalendarSampleApp");

            if (userName != null && userName.Length > 0)
            {
                service.setUserCredentials(userName, passWord);
            }

            // only get event's for today - 1 month until today + 1 year

            query.Uri = new Uri(calendarURI);

            query.StartTime = DateTime.Now.AddDays(-28);
            query.EndTime = DateTime.Now.AddMonths(6);


            EventFeed calFeed = service.Query(query);

            // now populate the calendar
            while (calFeed != null && calFeed.Entries.Count > 0)
            {
                // look for the one with dinner time...
                foreach (EventEntry entry in calFeed.Entries)
                {
                    this.entryList.Add(entry);
                    if (entry.Times.Count > 0)
                    {
                        foreach (When w in entry.Times )
                        {
                            dates.Add(w.StartTime);
                        }
                    }
                }
                // just query the same query again.
                query.Uri = new Uri(calFeed.NextChunk);
                calFeed = service.Query(query);
            }

            DateTime[] aDates = new DateTime[dates.Count];

            int i =0;
            foreach (DateTime d in dates)
            {
                aDates[i++] = d;
            }

           
            this.calendarControl.BoldedDates = aDates;

On 9/26/06, Rienco <[EMAIL PROTECTED]> wrote:

Hmm i got this for now:

           Dim ArrJaar(10) As Integer
            Dim ArrMaand(10) As Integer
            Dim ArrDag(10) As Integer

            For Each datums As Google.GData.Extensions.When In
feedEntry.Times
                'datums naar array
                ArrJaar(i) = datums.StartTime.Year
                ArrMaand(i) = datums.StartTime.Month
                ArrDag(i) = datums.StartTime.Day

                i = i + 1
                Console.WriteLine("When: " + datums.StartTime.Date + "
" + _
                    datums.EndTime.Date)

            Next

            'output voor de maandkalender
            For Each jaar As Integer In ArrJaar
                For Each maand As Integer In ArrMaand
                    For Each dag As Integer In ArrDag

                        cal2.AnnuallyBoldedDates = New
System.DateTime() _
                        {New System.DateTime(jaar, maand, dag, 0, 0, 0,
0)}
                    Next
                Next
            Next

But i get the error "Year, Month, and Day parameters describe an
un-representable DateTime." That's because he clears the array "dag"
when i ask for him in the las For Each.

Anyone a solution?






--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to