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

Changing time format in RadCalendar's Day/MultiDay view modes

4 Answers 101 Views
Calendar & Scheduling
This is a migrated thread and some comments may be shown as answers.
Mehdi
Top achievements
Rank 1
Veteran
Mehdi asked on 23 Dec 2020, 08:21 PM

Is there a superman who can tell me how I change the time format of Xamarin RadCalendar? 

P.s.1. as the attached screenshots show, the time format doesn't match the OS time format settings, neither for UWP nor for Android.

P.s.2. for UWP the problem is even worse because even the AM/PM abbreviations aren't displayed.

4 Answers, 1 is accepted

Sort by
0
Accepted
Didi
Telerik team
answered on 25 Dec 2020, 07:30 AM

Hi Mehdi,

The available timeline settings are described inside the DayView Settings and MultiDayView Settings. There is not time format settings option. You can log a feature request in the feedback portal. The request will be reviewed and its status will be changed accordingly. 

On Android, I have tested on emulator and the timeline format is changed from AM/PM to 24h format:

Local default AM/PM:

 

24h format:

 

On UWP: The format is 24h. This behavior comes from the native UWP calendar control. iOS, Android, and UWP calendars are 3 different native controls and do not have 100% matching appearance across the platforms. Here is the native UWP Calendar documentation and how the MultiDayView looks: https://docs.telerik.com/devtools/universal-windows-platform/controls/radcalendar/multidayview 

Let me know if I can assist with anything else.

Regards,
Didi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 25 Dec 2020, 03:27 PM

Hi Didi,

Thanks a lot. Sure 👍

0
Mehdi
Top achievements
Rank 1
Veteran
answered on 02 Jan 2021, 11:08 PM

Feature has been requested:

https://feedback.telerik.com/xamarin/1500750-being-able-to-change-time-format-in-radcalendar-s-day-multiday-view-modes

0
Didi
Telerik team
answered on 05 Jan 2021, 11:28 AM

Hi Mehdi,

Thank you for submitting the feature request. I have changed its status to Unplanned - which means it is a valid request. 

We have found a way to set a time format on Android for the timeline, Please note that the timeline is available for Day and MultiDayViews. You will need to implement a custom renderer for Android.

For example how the custom renderer class should be implemented:

using Android.Content;
using App5.Droid;
using Java.Util;
using Telerik.XamarinForms.InputRenderer.Android;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly: ExportRenderer(typeof(Telerik.XamarinForms.Input.RadCalendar), typeof(CustomCalendarRenderer))]


namespace App5.Droid
{
    public class CustomCalendarRenderer : CalendarRenderer
    {
        public CustomCalendarRenderer(Context context) : base(context)
        {

        }

        protected override void OnElementChanged(ElementChangedEventArgs<Telerik.XamarinForms.Input.RadCalendar> e)
        {
            base.OnElementChanged(e);

            var control = Control;

            control.MultiDayView.DayEventsViewStyle.TimeLabelFormat = new Java.Text.SimpleDateFormat("HH:mm:ss", Locale.Us);
            control.DayView.DayEventsViewStyle.TimeLabelFormat = new Java.Text.SimpleDateFormat("HH:mm:ss", Locale.Us);
        }
    }
}
 

For AgendaView there is a date and time format settings option. Please check here for more details https://docs.telerik.com/devtools/xamarin/controls/calendar/view-modes/calendar-agendaview#date-and-time-format-settings

 

About MonthView mode, there isn't a time ruler and this scenario is not valid for month view.

I hope the provided information was helpful. 

Regards,
Didi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Calendar & Scheduling
Asked by
Mehdi
Top achievements
Rank 1
Veteran
Answers by
Didi
Telerik team
Mehdi
Top achievements
Rank 1
Veteran
Share this question
or