Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
105
Meridiem value is not updating correctly in XamDateTimeEditor control.
posted

Hi,

We are using XamDateTimeEditor control in our application, to which we need to get default value (12:00:00 AM) when user selects a date in datetime picker. We set the default value in lostfocus() event.

I have created a sample application to replicate the issue:

Here is the xaml code:

<StackPanel Orientation="Vertical">

<igEditors:XamDateTimeEditor Name="xamdate" Format="MM/dd/yy HH:mm:ss" Width="200" Height="30" Mask="mm/dd/yy hh:mm:ss tt" LostFocus="XamDateTimeEditor_LostFocus"/>

</StackPanel>

Code behind

private void XamDateTimeEditor_LostFocus(object sender, RoutedEventArgs e)

{

XamDateTimeEditor XamDateTimeEditor = (sender as XamDateTimeEditor);

DateTime? dt = XamDateTimeEditor.DateValue;

if (dt.HasValue)

{

XamDateTimeEditor.Value = dt.Value;

}

}

The problem is:


1. User selects a date in datetime picker and deletes meridiem value(AM).
 
2. For instance, user selects 6 September 2016. Then the value appear along with default time as shown below:
 
3. Now, user deletes meridiem value (AM )and clicks on dropdown arrow. At this point PM is appearing. But user expects AM as it was default time.

 

Please suggest the solution to resolve this.


Note:

1.  This behavior is not seen when Time portion value is between (00:00:00 to 11:59:00) , other than this value i.e., 12:00:00 to 12:59:00 issue is observed.  Is this control behavior ? Please let us know.
2.  Above mention Sample application is what we have in our application, but this problem is also seen if there is no event added to XamDateTimeEditor control.

Please respond as soon as possible.

Thanks,
Srilaxmi