]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/parts/library/hours.tt2
%l instead of %H if we're using AM/PM for default time formats
[working/Evergreen.git] / Open-ILS / src / templates / opac / parts / library / hours.tt2
1 [% time_format = ctx.get_org_setting(ctx.library.id, 'format.time');
2
3    UNLESS time_format;
4        time_format = '%l:%M %p';
5    END;
6
7    USE date (format = time_format);
8    today = date.format(format = '%Y-%d-%b ');
9    # We need to add "today" to the opening/closing hours for Date input
10 -%]
11 <h2>[% l('Opening hours') %]</h2>
12 [%- IF ctx.hours.dow_0_open == ctx.hours.dow_0_close; %]
13 <div class="opening-hours">[% l('Monday: closed') %]</div>
14 [%- ELSE %]
15 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday" />[%
16     l('Monday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_0_open) _ '</span>',
17      '<span property="closes">' _ date.format(today _ ctx.hours.dow_0_close) _ '</span>') -%]
18 </div>
19 [%- END %]
20 [%- IF ctx.hours.dow_1_open == ctx.hours.dow_1_close; %]
21 <div class="opening-hours">[% l('Tuesday: closed') %]</div>
22 [%- ELSE %]
23 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />[%
24     l('Tuesday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_1_open) _ '</span>',
25      '<span property="closes">' _ date.format(today _ ctx.hours.dow_1_close) _ '</span>') -%]
26 </div>
27 [%- END %]
28 [%- IF ctx.hours.dow_2_open == ctx.hours.dow_2_close; %]
29 <div class="opening-hours">[% l('Wednesday: closed') %]</div>
30 [%- ELSE %]
31 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday" />[%
32     l('Wednesday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_2_open) _ '</span>',
33      '<span property="closes">' _ date.format(today _ ctx.hours.dow_2_close) _ '</span>') -%]
34 </div>
35 [%- END %]
36 [%- IF ctx.hours.dow_3_open == ctx.hours.dow_3_close; %]
37 <div class="opening-hours">[% l('Thursday: closed') %]</div>
38 [%- ELSE %]
39 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday" />[%
40     l('Thursday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_3_open) _ '</span>',
41      '<span property="closes">' _ date.format(today _ ctx.hours.dow_3_close) _ '</span>') -%]
42 </div>
43 [%- END %]
44 [%- IF ctx.hours.dow_4_open == ctx.hours.dow_4_close; %]
45 <div class="opening-hours">[% l('Friday: closed') %]</div>
46 [%- ELSE %]
47 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday" />[%
48     l('Friday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_4_open) _ '</span>',
49      '<span property="closes">' _ date.format(today _ ctx.hours.dow_4_close) _ '</span>') -%]
50 </div>
51 [%- END %]
52 [%- IF ctx.hours.dow_5_open == ctx.hours.dow_5_close; %]
53 <div class="opening-hours">[% l('Saturday: closed') %]</div>
54 [%- ELSE %]
55 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday" />[%
56     l('Saturday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_5_open) _ '</span>',
57      '<span property="closes">' _ date.format(today _ ctx.hours.dow_5_close) _ '</span>') -%]
58 </div>
59 [%- END %]
60 [%- IF ctx.hours.dow_6_open == ctx.hours.dow_6_close; %]
61 <div class="opening-hours">[% l('Sunday: closed') %]</div>
62 [%- ELSE %]
63 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Sunday" />[%
64     l('Sunday: [_1] - [_2]', '<span property="opens">' _ date.format(today _ ctx.hours.dow_6_open) _ '</span>',
65      '<span property="closes">' _ date.format(today _ ctx.hours.dow_6_close) _ '</span>') -%]
66 </div>
67 [%- END %]