1 [% time_format = ctx.get_org_setting(ctx.library.id, 'format.time');
4 time_format = '%l:%M %p';
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
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>
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>') -%]
20 [%- IF ctx.hours.dow_1_open == ctx.hours.dow_1_close; %]
21 <div class="opening-hours">[% l('Tuesday: closed') %]</div>
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>') -%]
28 [%- IF ctx.hours.dow_2_open == ctx.hours.dow_2_close; %]
29 <div class="opening-hours">[% l('Wednesday: closed') %]</div>
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>') -%]
36 [%- IF ctx.hours.dow_3_open == ctx.hours.dow_3_close; %]
37 <div class="opening-hours">[% l('Thursday: closed') %]</div>
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>') -%]
44 [%- IF ctx.hours.dow_4_open == ctx.hours.dow_4_close; %]
45 <div class="opening-hours">[% l('Friday: closed') %]</div>
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>') -%]
52 [%- IF ctx.hours.dow_5_open == ctx.hours.dow_5_close; %]
53 <div class="opening-hours">[% l('Saturday: closed') %]</div>
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>') -%]
60 [%- IF ctx.hours.dow_6_open == ctx.hours.dow_6_close; %]
61 <div class="opening-hours">[% l('Sunday: closed') %]</div>
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>') -%]