hours.tt2 does not like examples given for format.time setting

Bug #1326149 reported by Jason Etheridge
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Evergreen
Fix Released
Undecided
Unassigned

Bug Description

hours.tt2 powers part of the "library page" that can get linked to in the TPAC

The URL resembles this: http://demo.evergreencatalog.com/eg/opac/library/BR4

This interface will try to make use of the Library Setting "Format Times with this pattern." The description for that setting offers these examples "HH:mm" and "h:m:s.SSS a z". But this particular interface is expecting something like "%l:%M %p".

So you end up getting letters instead of actual times when the hours are displayed with such settings as the first examples.

Tags: pullrequest
Revision history for this message
Jo-Anne Teeuwsen (jteeuwsen) wrote :

This is a "nice to have" feature. Using the Library Info URL setting in the Library Settings Editor to point to an external web page with hours has been a good workaround for us.

Revision history for this message
Dan Scott (denials) wrote :

It's more than a "nice to have" feature, as having correctly formatted library structured data (as is otherwise provided in the default library pages, and is unlikely to be provided by pages pointed to using the Library Info URL setting) is required for search engines to be able to accurately determine library contact information, location, and opening hours.

The problem is that the library setting format.time uses Dojo and thus the Unicode date/time formatting patterns, as mentioned here http://dojotoolkit.org/reference-guide/1.9/dojo/date/locale/format.html and http://unicode.org/reports/tr35/tr35-6.html#timeFormats, while the TPAC pages use the Template::Plugin::Date module and thus the POSIX strftime date/time formatting patterns, as mentioned here: http://www.template-toolkit.org/docs/modules/Template/Plugin/Date.html

These are clearly not compatible formats, as Jason pointed out.

We should probably do three things:

1) Clearly document that the format.time library setting uses the Unicode date/time formatting patterns so that libraries have a better idea of what they should enter to provide a valid non-default setting for the staff client, and note that it is only used by the staff client;

2) Use a simple config.tt2-settable TIME_FORMAT setting for the human-readable version that mirrors how we currently make it possible to override the default DATE_FORMAT setting for the TPAC;

3) We should provide the machine-readable times in hh:mm:ss[Z|(+|-)hh:mm] format per http://schema.org/Time via a @content attribute on the HTML element, and might as well turn that HTML element into a <time> element instead of a meaningless <span> element.

Revision history for this message
Dan Scott (denials) wrote :

Pushed http://git.evergreen-ils.org/?p=working/Evergreen.git;a=shortlog;h=refs/heads/user/dbs/lp1326149_library_hours_display which addresses #2 and #3, thus resolving the core errors.

Perhaps we should leave #1 to a separate bug as it is truly a nice-to-have, whereas #2 and #3 are potentially very real runtime problems.

Changed in evergreen:
milestone: none → 2.6.2
status: New → Confirmed
tags: added: pullrequest
Revision history for this message
Ben Shum (bshum) wrote :

Picked to master and rel_2_6. Thanks Dan!

Changed in evergreen:
status: Confirmed → Fix Committed
Changed in evergreen:
milestone: 2.6.3 → 2.6.2
Changed in evergreen:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.