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
75
XamDateTimeEditor - Time in 24 hour format
posted

My Problem is similar to http://news.infragistics.com/forums/t/39342.aspx. Except I want the user to be able to enter in time in 24hour format then on loss of focus the box the time is displayed in 12 hour format.

XamDateTimeEditor does not allow a mask of HH:mm tt, just a format of HH:mm tt

I am lead to believe that I will have to wrap XamDateTimeEditor and override input? Any other suggestions?

  • 54937
    Verified Answer
    Offline posted

    The Mask property supports specific characters and tokens that are documented here. Those are not the same characters that are used for the Format property which corresponds with the values available for formatting strings in .net (both standard and custom). Based on your description then you would use a Mask of "hh:mm" (the absence of the am/pm token indicates 24 hour) and a Format of "hh:mm tt".

  • 9836
    posted

    This is because HH is not a valid token. You can use only combination of these tokens when defining the mask: hh, mm, ss, tt (for AM/PM) and the date : mm, dd, yy.

    <StackPanel Orientation="Vertical">

            <!--PM-->

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

            <!--AM-->

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

    </StackPanel>

    Hope that helps!