From: Dan Scott Date: Tue, 17 Dec 2013 17:04:05 +0000 (-0500) Subject: Library info page: handle closed days properly X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=beefa712c609ed119eb43f1dd9a4b438c076aa5a;p=working%2FEvergreen.git Library info page: handle closed days properly If the open and close time for a given day is 00:00, then the library is closed. Simplify this a little bit by just checking to see if the times are equal. Signed-off-by: Dan Scott --- diff --git a/Open-ILS/src/templates/opac/parts/library/hours.tt2 b/Open-ILS/src/templates/opac/parts/library/hours.tt2 index 07c559f853..4b433098c1 100644 --- a/Open-ILS/src/templates/opac/parts/library/hours.tt2 +++ b/Open-ILS/src/templates/opac/parts/library/hours.tt2 @@ -1,29 +1,57 @@

[% l('Opening hours') %]

+[%- IF ctx.hours.dow_0_open == ctx.hours.dow_0_close; %] +
l('Monday: closed')
+[%- ELSE %]
[% l('Monday: [_1]-[_2]', '' _ ctx.hours.dow_0_open.substr(0, 5) _ '', '' _ ctx.hours.dow_0_close.substr(0, 5) _ '') -%]
+[%- END %] +[%- IF ctx.hours.dow_1_open == ctx.hours.dow_1_close; %] +
l('Tuesday: closed')
+[%- ELSE %]
[% l('Tuesday: [_1]-[_2]', '' _ ctx.hours.dow_1_open.substr(0, 5) _ '', '' _ ctx.hours.dow_1_close.substr(0, 5) _ '') -%]
+[%- END %] +[%- IF ctx.hours.dow_2_open == ctx.hours.dow_2_close; %] +
l('Wednesday: closed')
+[%- ELSE %]
[% l('Wednesday: [_1]-[_2]', '' _ ctx.hours.dow_2_open.substr(0, 5) _ '', '' _ ctx.hours.dow_2_close.substr(0, 5) _ '') -%]
+[%- END %] +[%- IF ctx.hours.dow_3_open == ctx.hours.dow_3_close; %] +
l('Thursday: closed')
+[%- ELSE %]
[% l('Thursday: [_1]-[_2]', '' _ ctx.hours.dow_3_open.substr(0, 5) _ '', '' _ ctx.hours.dow_3_close.substr(0, 5) _ '') -%]
+[%- END %] +[%- IF ctx.hours.dow_4_open == ctx.hours.dow_4_close; %] +
l('Friday: closed')
+[%- ELSE %]
[% l('Friday: [_1]-[_2]', '' _ ctx.hours.dow_4_open.substr(0, 5) _ '', '' _ ctx.hours.dow_4_close.substr(0, 5) _ '') -%]
+[%- END %] +[%- IF ctx.hours.dow_5_open == ctx.hours.dow_5_close; %] +
l('Saturday: closed')
+[%- ELSE %]
[% l('Saturday: [_1]-[_2]', '' _ ctx.hours.dow_5_open.substr(0, 5) _ '', '' _ ctx.hours.dow_5_close.substr(0, 5) _ '') -%]
+[%- END %] +[%- IF ctx.hours.dow_6_open == ctx.hours.dow_6_close; %] +
l('Sunday: closed')
+[%- ELSE %]
[% l('Sunday: [_1]-[_2]', '' _ ctx.hours.dow_6_open.substr(0, 5) _ '', '' _ ctx.hours.dow_6_close.substr(0, 5) _ '') -%]
+[%- END %]