LiveWhale CMS

Welcome, Guest Login

Support Center

Our documentation is moving:

Please check for the most up-to-date LiveWhale CMS and LiveWhale Calendar documentation. The below legacy documentation will remain available as a reference until the documentation migration is complete.

Change widget time formats with onWidgetFormat

Last Updated: Feb 27, 2014 04:54PM PST

LiveWhale’s PHP-based time defaults giving your AP- or Chicago-style enforcer fits? You can update your time defaults site-wide with this small application module.

Once in place, this module updates the times output for any events widget to appear in the format you desire. By default this module adds a space before the meridian, and inserts periods. It also removes :00 when present.

Find the code in this Gist: ​
Place this module in a folder called “time_formatter” in your LiveWhale backend /client folder.

This is just one example of how to modify widget variables (the values the will be inserted into a widget) prior to actual insertion. You can use similar means to alter any variable in any widget type, even limiting it to certain areas of the site, by person, ip address or any other factor available at the time of output.
seconds ago
a minute ago
minutes ago
an hour ago
hours ago
a day ago
days ago
Invalid characters found