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
13 <h3>[% l('Opening hours') %]</h3>
16 open = today _ ctx.hours.dow_0_open;
17 close = today _ ctx.hours.dow_0_close;
20 <div class="opening-hours">[% l('Monday: closed') %]</div>
22 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday" />[%
23 l('Monday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
24 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
29 open = today _ ctx.hours.dow_1_open;
30 close = today _ ctx.hours.dow_1_close;
33 <div class="opening-hours">[% l('Tuesday: closed') %]</div>
35 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />[%
36 l('Tuesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
37 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
42 open = today _ ctx.hours.dow_2_open;
43 close = today _ ctx.hours.dow_2_close;
46 <div class="opening-hours">[% l('Wednesday: closed') %]</div>
48 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday" />[%
49 l('Wednesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
50 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
55 open = today _ ctx.hours.dow_3_open;
56 close = today _ ctx.hours.dow_3_close;
59 <div class="opening-hours">[% l('Thursday: closed') %]</div>
61 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday" />[%
62 l('Thursday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
63 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
68 open = today _ ctx.hours.dow_4_open;
69 close = today _ ctx.hours.dow_4_close;
72 <div class="opening-hours">[% l('Friday: closed') %]</div>
74 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday" />[%
75 l('Friday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
76 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
81 open = today _ ctx.hours.dow_5_open;
82 close = today _ ctx.hours.dow_5_close;
85 <div class="opening-hours">[% l('Saturday: closed') %]</div>
87 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday" />[%
88 l('Saturday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
89 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]
94 open = today _ ctx.hours.dow_6_open;
95 close = today _ ctx.hours.dow_6_close;
98 <div class="opening-hours">[% l('Sunday: closed') %]</div>
100 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Sunday" />[%
101 l('Sunday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
102 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>') -%]