3 TIME_FORMAT = '%l:%M %p';
6 time_format = TIME_FORMAT;
8 USE date (format = time_format);
9 today = date.format(format = '%Y-%m-%d ');
10 # We need to add "today" to the opening/closing hours for Date input
12 <h2>[% l('Opening hours') %]</h2>
15 open = today _ ctx.hours.dow_0_open;
16 close = today _ ctx.hours.dow_0_close;
19 <div class="opening-hours">[% l('Monday: closed') %]</div>
21 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday" />[%
22 l('Monday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
23 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
28 open = today _ ctx.hours.dow_1_open;
29 close = today _ ctx.hours.dow_1_close;
32 <div class="opening-hours">[% l('Tuesday: closed') %]</div>
34 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />[%
35 l('Tuesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
36 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
41 open = today _ ctx.hours.dow_2_open;
42 close = today _ ctx.hours.dow_2_close;
45 <div class="opening-hours">[% l('Wednesday: closed') %]</div>
47 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday" />[%
48 l('Wednesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
49 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
54 open = today _ ctx.hours.dow_3_open;
55 close = today _ ctx.hours.dow_3_close;
58 <div class="opening-hours">[% l('Thursday: closed') %]</div>
60 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday" />[%
61 l('Thursday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
62 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
67 open = today _ ctx.hours.dow_4_open;
68 close = today _ ctx.hours.dow_4_close;
71 <div class="opening-hours">[% l('Friday: closed') %]</div>
73 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday" />[%
74 l('Friday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
75 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
80 open = today _ ctx.hours.dow_5_open;
81 close = today _ ctx.hours.dow_5_close;
84 <div class="opening-hours">[% l('Saturday: closed') %]</div>
86 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday" />[%
87 l('Saturday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
88 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
93 open = today _ ctx.hours.dow_6_open;
94 close = today _ ctx.hours.dow_6_close;
97 <div class="opening-hours">[% l('Sunday: closed') %]</div>
99 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Sunday" />[%
100 l('Sunday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
101 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]