DisplayDate set on Today - calendar shows Februari

2 posts, 0 answers
  1. Eric
    Eric avatar
    16 posts
    Member since:
    May 2014

    Posted 02 Mar 2015 Link to this post

    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.
  2. Antony Jekov
    Admin
    Antony Jekov avatar
    88 posts

    Posted 04 Mar 2015 Link to this post

    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.

     
  3. DevCraft banner
Back to Top