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

AM/PM DateTimePicker Bug

1 Answer 569 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 05 Jul 2018, 06:45 PM

Target environment where bug is replicable: Windows 10 Enterprise 64-bit.

There is a bug in the DateTimePicker widget.  If you select a time by clicking in the UI, it partially disregards your selection and forces the time to be set in AM time.  As an example, select 3 PM in the UI and the result will be set to 3 AM.  The only exception to this is with 12PM (or any derivative of that hour, such as 12:30PM).  Presumably that is because the default time of a DateTimePicker is 12PM.

I do not know what version of Telerik we use at my company--someone else in my company has the license information and I cannot be bothered.  Regardless, it does not matter.  Just go to the Telerik website with any Windows 10 machine and replicate the issue.  Link here: https://demos.telerik.com/aspnet-ajax/datetimepicker/overview/defaultcs.aspx

This bug cannot be replicated in all environments.  For example, at my office, we have a server where the behavior is not replicated (Windows Server 2012 R2 64-bit).

1 Answer, 1 is accepted

Sort by
0
Attila Antal
Telerik team
answered on 10 Jul 2018, 03:31 PM
Hi Chris,

Thank you for pointing out this issue. It is caused by the lack of the AM/PM designator which it is necessary to maintain the distinction between AM and PM. Also described in The "tt" custom format specifier article.

"The "tt" custom format specifier (plus any number of additional "t" specifiers) represents the entire AM/PM designator. The appropriate localized designator is retrieved from the DateTimeFormatInfo.AMDesignator or DateTimeFormatInfo.PMDesignator property of the current or specific culture. The AM designator is used for all times from 0:00:00 (midnight) to 11:59:59.999. The PM designator is used for all times from 12:00:00 (noon) to 23:59:59.999.

Make sure to use the "tt" specifier for languages for which it is necessary to maintain the distinction between AM and PM
"

By adding the AM/PM designator to the custom format will fix the issue, which will be updated in our demo accordingly.

Example:
<telerik:RadDateTimePicker ID="RadDateTimePicker1" runat="server" DateInput-DateFormat="d h:m s tt">
</telerik:RadDateTimePicker>

I have updated your Telerik points as a token of gratitude for reporting the issue.

Thank you!

Kind regards,
Attila Antal
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
DateTimePicker
Asked by
Chris
Top achievements
Rank 1
Answers by
Attila Antal
Telerik team
Share this question
or