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;
17 note = ctx.hours.dow_0_note;
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>')
26 [% IF ctx.hours.dow_0_note %]
27 <span>[%l('(' _ note _ ')')%]</span>
33 open = today _ ctx.hours.dow_1_open;
34 close = today _ ctx.hours.dow_1_close;
35 note = ctx.hours.dow_1_note;
38 <div class="opening-hours">[% l('Tuesday: closed') %]</div>
40 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />[%
41 l('Tuesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
42 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
44 [% IF ctx.hours.dow_1_note %]
45 <span>[%l('(' _ note _ ')')%]</span>
51 open = today _ ctx.hours.dow_2_open;
52 close = today _ ctx.hours.dow_2_close;
53 note = ctx.hours.dow_2_note;
56 <div class="opening-hours">[% l('Wednesday: closed') %]</div>
58 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday" />[%
59 l('Wednesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
60 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
62 [% IF ctx.hours.dow_2_note %]
63 <span>[%l('(' _ note _ ')')%]</span>
69 open = today _ ctx.hours.dow_3_open;
70 close = today _ ctx.hours.dow_3_close;
71 note = ctx.hours.dow_3_note;
74 <div class="opening-hours">[% l('Thursday: closed') %]</div>
76 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday" />[%
77 l('Thursday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
78 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
80 [% IF ctx.hours.dow_3_note %]
81 <span>[%l('(' _ note _ ')')%]</span>
87 open = today _ ctx.hours.dow_4_open;
88 close = today _ ctx.hours.dow_4_close;
89 note = ctx.hours.dow_4_note;
92 <div class="opening-hours">[% l('Friday: closed') %]</div>
94 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday" />[%
95 l('Friday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
96 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
98 [% IF ctx.hours.dow_4_note %]
99 <span>[%l('(' _ note _ ')')%]</span>
105 open = today _ ctx.hours.dow_5_open;
106 close = today _ ctx.hours.dow_5_close;
107 note = ctx.hours.dow_5_note;
110 <div class="opening-hours">[% l('Saturday: closed') %]</div>
112 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday" />[%
113 l('Saturday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
114 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
116 [% IF ctx.hours.dow_5_note %]
117 <span>[%l('(' _ note _ ')')%]</span>
123 open = today _ ctx.hours.dow_6_open;
124 close = today _ ctx.hours.dow_6_close;
125 note = ctx.hours.dow_6_note;
128 <div class="opening-hours">[% l('Sunday: closed') %]</div>
130 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Sunday" />[%
131 l('Sunday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
132 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
134 [% IF ctx.hours.dow_6_note %]
135 <span>[%l('(' _ note _ ')')%]</span>