This is a migrated thread and some comments may be shown as answers.

DisplayDate set on Today - calendar shows Februari

1 Answer 32 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Eric
Top achievements
Rank 1
Eric asked on 02 Mar 2015, 08:10 AM
Hi,

As you can see in the attachment, I've loaded the Calendar with the following properties (March 2):

01.var calendarView = FindViewById<RadCalendarView>(Resource.Id.calendarView);
02.Calendar calendar = new GregorianCalendar(DateTime.Now.Year, 1, DateTime.Now.Day);
03.calendarView.DisplayDate = calendar.TimeInMillis;
04.calendarView.SelectionMode = CalendarSelectionMode.Single;
05. 
06.calendarView.EventAdapter.Renderer.EventRenderMode = EventRenderMode.Shape;
07.calendarView.ShowTitle = false;
08.calendarView.CustomizationRule = new ConnectedCustomizationRule();
09. 
10.calendarView.DisplayDateChanged += (sender, args) =>
11.{}


When the view is rendered - March 2nd is loaded, but the calendar is still in Februari. I would like to have March visible when the view renders. Can someone give me some tips?

Many thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Antony Jekov
Telerik team
answered on 04 Mar 2015, 09:39 AM
Hello Eric,

Thank you for contacting the Android team.

By using the code you provided:
Calendar calendar = new GregorianCalendar(DateTime.Now.Year, 1, DateTime.Now.Day);
calendarView.DisplayDate = calendar.TimeInMillis;
you are actually setting the calendar display date to be February. DateTime.Now.Year is correct, DateTime.Now.Day is correct, but 1 as month is February.

By using the DisplayDate property you are not setting the today date, but only the display date.

Please let me know if this is helpful to you.

Regards,
Antony Jekov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Calendar
Asked by
Eric
Top achievements
Rank 1
Answers by
Antony Jekov
Telerik team
Share this question
or