IP 2010. Text Box with a data type of "time" .
If user types 945 the box sits there "red" because it needs a colon. OK, customer says, can you "stick" a colon in for my lazy users? Sure I say. Why not?
Well, I put a couple of rules together that run when a colon is missing (one for 3 digit and one for 4 digit using regex pattern matches \d\d\d or \d\d\d\d respectively). Great, no problem so far, the rule absolutely fires on 0345, for example.
Here's the Set Field's Value fx:
concat(0, substring(., 1, string-length(.) - 2), ":", substring(., string-length(.) - 1, 2))
Turns 345 into 03:45. But the datatype validation is failing; leaves it "red". If I type in the box, backspace over the last digit & retype it effectively not changing the string ONE LITTLE BIT the datatype validation passes muster.
I've tried number() around all the substrings, no joy. I don't see any "time()" converter.....very annoying.
Suggestions? (besides "no, your lazy users are just gonna have to type a colon you unreasonable customer you") ;-)