Smart Forms: Time Picker Type support Military Time?

  • 4 September 2014
  • 7 replies
  • 7 views

Badge +2

When working with time elements in smart forms, you can configure the time format for display in fields and lists.  This allows times to show up in military time. (HH:mm), which is desired in my project.

 

However, it seems the picker tool to allow users to enter time values does not format military time?  Only provides AM/PM radio buttons?

 

I looking for a way to allow time picker tool to accept military time input.

 

Thanks for confirmation on this limitation.

 

Scott


7 replies

Badge +9

This can be done, but it is kind of a pain. The first thing you want to do is go in to your web.config files for your SmartForms. Those can be found at the following:

  • [Drive]Files (x86)K2 blackpearlK2 smartforms Designer
  • [Drive]Program Files (x86)K2 blackpearlK2 SmartForms Runtime
     

In those web.config files (open them in notepad) you need to locate the following:

<!-- SmO Execution Settings -->

<add key="SmartObject.ExecutionCulture" value="en-US"/>

the "en-US" need to be changed to "hh:mm:ss". I am fairly certain that is what it needs to be changed too, but that is ISO format so verifying should be easy.

Additionally, to avoid issues with time discrepancies you should also ensure your local computer is on the same 24h clock.

Do an IISRESET and restart the K2 Host Server and you should be set.

Badge +2

Thanks for the suggestion, Austin,

 

Feels like this wil lonly change the display within the data entry form.. and not formally adjust the dialog to accept military time.  Will this somehow disable the AM/PM portion of data entry?  I would very much need those removed in this solution, since expecting 24 hour time.. but then also show option to select AM/PM is not a good option.

 

You also mention avoiding issues with time discrepancies and ensuring my local computer is on the same 24h clock. 

Are you suggesting that I just display 24 hour time on my machine keep data entry clear?  Or are you mentioning some other technical angle?

 

This smart form is expected to be deployed and view my numerous users, all over the US.. and obviously across various time zones.  I'm currently battling an issue with date entry taken from one timezone and then displayed in a browser running in another timezone.  Looking for best practice with K2 smartform when dealing with this.  Wondering if your comment about my local machine impacts my solution elsewhere.  (I'm just developing this form and will never use final business solution)

 

Thanks,

Scott

Badge +9

On my end it seems to work. I'm using BP 4.6.8/SF 1.0.7. I was wrong about what to set "<add key="SmartObject.ExecutionCulture" value=" to though. You need to pick a language and country that uses a 24 hour clock. So France or some such.

 

Badge +2

So, this solution does not remove the AM/PM radio buttons from the time picker dialog, correct?


13354iFB279CA51E78E713.png
Badge +9

http://imgur.com/a/0gM2u#5


No radio buttons and a 24h clock. Also, I figured out how to do this without web.config files by using styles.

Badge +10

an this be configured on a form level so that I may have various forms for different workflows and different times.

Badge +9

That's correct. This is unique to a given from and will not effect others.

Reply