I’d like to create a format for entering time duration information under the form hh:mm:ss (hour:minute:second). The aim would be to be able to integrate the duration of a recording, its start and also its end. This would be useful for our ‘Animal sound archive’ collection.
I’ve managed to create a format in the form ##:##:## but I’d like it to default to 00:00:00 and I’d also like the first digit to be limited to numbers 1 to 24, and the second and third to be limited to numbers 1 to 60.
Thanks for your question! You were in the right place when you asked about this problem, as a regular expression field format is the only way to handle this as you describe.
In the Field Formatter app resource (UIFormatters, you can create one if none exists), you need to add the following format:
[!warning]
Make sure to replace the class and fieldname with the name of the table (e.g. CollectingEvent) and the name of the field (e.g. text5) in the corresponding spaces below. You can create multiple formats for additional fields if needed.
In your View Definition XML, you just need to make sure the field you want to format is visible and this is where you would want to set the default for the field (e.g. 00:00:00):