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;
18 note = ctx.hours.dow_0_note;
21 <div class="opening-hours">[% l('Monday: closed') %]</div>
23 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday" />[%
24 l('Monday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
25 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
27 [% IF ctx.hours.dow_0_note %]
28 <span>[%l('(' _ note _ ')')%]</span>
34 open = today _ ctx.hours.dow_1_open;
35 close = today _ ctx.hours.dow_1_close;
36 note = ctx.hours.dow_1_note;
39 <div class="opening-hours">[% l('Tuesday: closed') %]</div>
41 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Tuesday" />[%
42 l('Tuesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
43 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
45 [% IF ctx.hours.dow_1_note %]
46 <span>[%l('(' _ note _ ')')%]</span>
52 open = today _ ctx.hours.dow_2_open;
53 close = today _ ctx.hours.dow_2_close;
54 note = ctx.hours.dow_2_note;
57 <div class="opening-hours">[% l('Wednesday: closed') %]</div>
59 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Wednesday" />[%
60 l('Wednesday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
61 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
63 [% IF ctx.hours.dow_2_note %]
64 <span>[%l('(' _ note _ ')')%]</span>
70 open = today _ ctx.hours.dow_3_open;
71 close = today _ ctx.hours.dow_3_close;
72 note = ctx.hours.dow_3_note;
75 <div class="opening-hours">[% l('Thursday: closed') %]</div>
77 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Thursday" />[%
78 l('Thursday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
79 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
81 [% IF ctx.hours.dow_3_note %]
82 <span>[%l('(' _ note _ ')')%]</span>
88 open = today _ ctx.hours.dow_4_open;
89 close = today _ ctx.hours.dow_4_close;
90 note = ctx.hours.dow_4_note;
93 <div class="opening-hours">[% l('Friday: closed') %]</div>
95 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Friday" />[%
96 l('Friday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
97 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
99 [% IF ctx.hours.dow_4_note %]
100 <span>[%l('(' _ note _ ')')%]</span>
106 open = today _ ctx.hours.dow_5_open;
107 close = today _ ctx.hours.dow_5_close;
108 note = ctx.hours.dow_5_note;
111 <div class="opening-hours">[% l('Saturday: closed') %]</div>
113 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Saturday" />[%
114 l('Saturday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
115 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
117 [% IF ctx.hours.dow_5_note %]
118 <span>[%l('(' _ note _ ')')%]</span>
124 open = today _ ctx.hours.dow_6_open;
125 close = today _ ctx.hours.dow_6_close;
126 note = ctx.hours.dow_6_note;
129 <div class="opening-hours">[% l('Sunday: closed') %]</div>
131 <div class="opening-hours" property="openingHoursSpecification" typeof="OpeningHoursSpecification"><link property="dayOfWeek" href="http://purl.org/goodrelations/v1#Sunday" />[%
132 l('Sunday: [_1] - [_2]', '<time property="opens" content="' _ date.format(open, format => '%H:%M:%S') _ '">' _ date.format(open) _ '</time>',
133 '<time property="closes" content="' _ date.format(close, format => '%H:%M:%S') _ '">' _ date.format(close) _ '</time>')
135 [% IF ctx.hours.dow_6_note %]
136 <span>[%l('(' _ note _ ')')%]</span>