I need to add one customer field as From Time to To Time and want that user should input time only in the following format:
HH:MM:SS i.e. 18:20:30 and 18:30:30
How it can be done? and is it possible that in the next custom field, it automatically calculate the difference of From Time to To Time i.e. 10 Minutes.
Awaiting your reply.
How to write regular expression for Time
Moderators: Developer, Contributor
Re: How to write regular expression for Time
We don't have "time" type custom fields. I suggest instead to use text field with a regular expression to validate the user's input, maybe something like (not tested)
With regards to the calculation, I can't think of a way to easily do it out of the box. Maybe you can write a custom plugin.
Code: Select all
[0-2][0-9]:[0-5][0-9]:[0-5][0-9]-
shahzadzaveri
Re: How to write regular expression for Time
Thanks dregad ..... so nice of you ... it has resolved my issue ...