Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control - InfoPath Dev
in

InfoPath Dev

Having trouble finding a blog or post that answers your question? Check out our Custom Search Page

Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

Last post 07-20-2011 02:54 PM by Dirkle. 9 replies.
Page 1 of 1 (10 items)
Sort Posts: Previous Next
  • 06-30-2011 08:05 AM

    Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

    Forum Community,

     

    I have an InfoPath form where I would like to display the time in 24-hour format. While the "date and time picker" control will accept 24-hour time formats, it automatically converts the time back to the 12-hour time format after tabbing out of the control. I've examined the properties for my date/time picker control and there's no setting for 24-hour time format. Does anyone know how to prevent the control from converting 24-hour time formatted values to 12-hour formatted time? I want to display all date/times in mililary format.

     

    Thanks,

     

    ~W

  • 06-30-2011 08:21 AM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

    Open up "Date Picker Properties" on your date picker control and click "Format.." next to Data Type.  Looks like MIL format is the last one listed under "Display the time like this".

  • 06-30-2011 08:44 AM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

     Hi Jimmy,

     

    I tried that previously, and it did not work. I tried again just now, and the time format continues to be displayed in 12-hour format.

     

    ~W

  • 06-30-2011 09:09 AM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

    It looks like if you select a time format that doesn't show "AM" next to it, it is 24 hour time - it works in my test template at least. Can you attach a sample form where the time format you anticipate to show 24 hour time doesn't? Under the Options tab....

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 06-30-2011 09:30 AM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

     Hilary,

     

    The date and time format settings are behaving strangely in my date/time picker control. After opening the properties for my control and selecting desired date format, the time format selection automatically goes to "(Do not display time)"; similarly, after selecting the desired time format, the date format selection automatically goes to "(Do not display date)". If you click "Ok" and reopen the date/time picker properties, only my date format selection shows; the time format selection still shows "(Do not display time)". Surprisingly, after viewing the form in preview mode, the control correctly displays the selected date in the desired format and the time is correctly displayed in the 24 hour time format. Do you observe the same behavior when modifying your date/time picker control properties?

     

    By the way, do you know of a Microsoft page where I can view know bugs with InfoPath that Microsoft plans to fix?

     

    Thanks,

     

    ~W

  • 06-30-2011 09:38 AM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

    What version of InfoPath are you using?

    In IP 2010, I have two controls when I add a date time picker - one for picking the date, which displays only the date, and one for entering the time, which displays only time.

    I don't know of any documention for known InfoPath bugs - whatever version of InfoPath / Office you are using, it is always good to make sure you have the latest service packs & updates installed.

    Hilary Stoupa
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 06-30-2011 09:55 AM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

     I'm running IP 2010.

     

    After additional research, I found the process by which Microsoft expects IP developers to set the format for the date and time fields within a date/time picker (DTP) control. It makes no sense whatsoever, but I now know logic behind Microsoft's madness :-)

     

    I have one final question for you that concerns the DTP I created a rule that sets the value of a DTP control based on the value in another DTP control on the form. My rule disables the DTP control containing the copied value, but I want to also make this control read-only. Currently, the calendar icon on the DTP control containing the copies value is disables, but a user can still modify the date. Do you know of a way to make this control read-only since read-only is not included among the DTP properties. The "text box" control has a read-only feature; I want the same functionality in my DTP control.

     

    Thanks,

     

    ~W

  • 06-30-2011 11:47 PM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

    Are you sure that users are able to modify the value in the DTP?  I just tried this, and while I can select the text in a disabled DTP, I can't modify the value.  Is this in the rich client or the browser?

    Jimmy Rishe / Software Developer / InfoPath MVP
    Qdabra Software
  • 07-01-2011 02:37 PM In reply to

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

     Hi Jimmy,

     

    After some research, I discovered that conditional formatting is the only way to implement read-only functionality on date/time picker controls; more specifically, a separate formatting rule is required to disable each of the text boxes that define a date/time picker control.  If you only set a rule to disable the text box for the date, users can still modify the value stored in the text box for the time.

     

    ~W

  • 07-20-2011 02:54 PM In reply to

    • Dirkle
    • Not Ranked
    • Joined on 07-20-2011
    • Posts 2

    Re: Displaying 24-hour time (military) using InfoPath "Date and Time Picker" control

     

    California_Developer:

    After additional research, I found the process by which Microsoft expects IP developers to set the format for the date and time fields within a date/time picker (DTP) control. It makes no sense whatsoever, but I now know logic behind Microsoft's madness :-)

     

    Can you describe this process? I'm trying to do the same thing and every time I try to implement a format, it selects "Do not display ...". It's getting really annoying. Thanks.

     

Page 1 of 1 (10 items)
Copyright © 2003-2014 Qdabra Software. All rights reserved.
View our Terms of Use.