Search

A new Extension, “Time Field” is now available for download. Comments and feedback can be left here but if you discover any issues, please post it on the issue tracker.

Time field accepts values in the format HH:MM:SS, where SS is optional. This is stored internally as an integer, representing the total number of seconds, so proper sorting is possible.

Filtering supports ranges via a {from} to {to} logic. E.G. 01:12:43 to 31:09 as well as single exact matching.

This Extension can be checked out from my Git repository http://github.com/pointybeard/extension--time-field/tree/master

Small bug report: when you enter 0:00 (midnight) Symphony will show an empty value in the backend (didn't test it on the frontend).

Edit: To be more precise, it will show an empty value while showing or editing an entry, not in the section's list view.

Another thing: is there a reason why time fields can not be used as dynamic options for select boxes?

Should all be working now. Try the above 1.3 release.

It does work - thanks!
But I found a new problem: When I use a time field as a dynamic option, I get a list with all times in seconds (86400) and not as formated time (24:00:00).

Ahh. True. Ill need to fix that.

Give that a go.

Dealing with some NY-based clients who can't seem to get their heads around the 24 hour clock.

How tricky would it be to get it to read am/pm like the date fields?

Actually, the time field is not really meant to be used as a clock. It stores time like a stop watch in the format hh:mm:ss. So, it allows something like 32:01:02 which has no way of being represented as clock time (hh:mm am/pm). In that example, 32:01:02 could mean "8:01:02 am", but re-saving it would end up as "08:01:02".

If all you ever did with the field was store time between "00:00" and "23:59:59" then perhaps you could alter the timeStringToInt(), parseTimeInt() and timeIntToString() function on lines 158, 163 and 171 to handle the format you're after.

I see. Very good.

I hacked together a workable solution of my own -- to be posted here if/when I polish it up.

Thanks very much.

I guess it wouldn’t be too difficult to omit seconds alltogether, however I do not dare hacking into the code … can anyone help me?

I think I managed to get rid of the seconds, it’s most likely flakey, still hope it works :)

Is anyone else still using this extension? I found and (I think) fixed a bug with events a little while ago and sent a pull request to the Symphonist repo, but wasn’t sure if that was the correct one to send pull requests to.

Create an account or sign in to comment.

Symphony • Open Source XSLT CMS

Server Requirements

  • PHP 5.3-5.6 or 7.0-7.3
  • PHP's LibXML module, with the XSLT extension enabled (--with-xsl)
  • MySQL 5.5 or above
  • An Apache or Litespeed webserver
  • Apache's mod_rewrite module or equivalent

Compatible Hosts

Sign in

Login details