Personal tools
You are here: Home Source News Software Plone in the Afternoon
Document Actions

Plone in the Afternoon

The default time display for Plone events is 24 hour time. Fine for the military, but "the clocks struck thirteen" never sounded right to my ears. So, I searched for a simple way to convert the time display to AM/PM time. However, Google failed to easily find me a solution. So, I investigated my own.

Turns out to be a quite simple change to /portal_skins/plone_content/event_view .

Customize this script, and change the following lines:

<span tal:replace="python:here.start().TimeMinutes()">Start Time</span> <span i18n:translate="event_to">to</span> <span tal:replace="python:here.end().TimeMinutes()">End Date Time</span>

To: <span i18n:translate="event_from">from</span> <span tal:replace="python:here.start().AMPMMinutes()">Start Time</span> <span i18n:translate="event_to">to</span> <span tal:replace="python:here.end().AMPMMinutes()">End Date Time</span>

The Zope Date class has several handy methods. In this case, we're just changing from the TimeMinutes() method to the AMPMMinutes() method, and we're done.

This change only affects the event view itself. The popups in the Calendar slot still show 24 hour time. I'll have to leave that to a later hack. :)

For your convenience, I've uploaded the complete customized event_view script

Houston Tech Calendar

Events in the Houston area that have caught our attention ... or attendance ;)

« July 2010 »
Su Mo Tu We Th Fr Sa
123
45678910
11121314151617
18192021222324
25262728293031
 

Powered by Plone CMS, the Open Source Content Management System Hosted by WebFaction

This site conforms to the following standards: