Time Format Issue

  • 3 October 2016
  • 0 replies
  • 1 view

Badge +9


 

Symptoms

 


When using styling to validate that an entry into text label is in fact formatted like a time. When doing this the form would execute a smartobject method to add the item to a sharepoint list. In doing this SharePoint would save the item and format it Date-Time.
 

 

Diagnoses

 


The SharePoint 2010 Date/Time column only presents the Date only OR Date and Time. There is no option for the column to show just the time.
 

 

Resolution

While this is ultimately a limitation in SharePoint K2 can work around it. First, rather than using a Date and Time column we used a single line text column. From there we forewent the styling as that ultimately passes a time to sharepoint to be butchered and instead leveraged the smartform control's pattern validation property which uses a regular expression to validate an entry: ^(([0-1]?[0-9])|([2][0-3])):([0-5]?[0-9])(:([0-5]?[0-9]))?$ That was the regular expression we used.

 

 



 

0 replies

Be the first to reply!

Reply