Skip to content

Commit

Permalink
Left pad time parts with a leading zero if needed, add hint about tim…
Browse files Browse the repository at this point in the history
…es being in 24-hour format
  • Loading branch information
kylemhall committed Aug 17, 2020
1 parent 86e2e2a commit c118114
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [1.0.6] - 2020-08-17
## Added
- Added default CURBSIDE notice
- Hours and minutes in configuration are now formatted correctly for 24-hour time

## [1.0.5] - 2020-08-17
## Changed
Expand Down
64 changes: 36 additions & 28 deletions Koha/Plugin/Com/ByWaterSolutions/CurbsidePickup/configure.tt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
[% USE KohaDates %]
[% USE format %]
[% USE format_minutes = format('%02d') %]
[% MACRO minutes_format BLOCK %][% IF m != "" %][% format_minutes(m) %][% END %][% END %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha: Curbside pickup: Configuration</title>
Expand Down Expand Up @@ -68,102 +71,107 @@
<legend>Curbside pickup hours for <i>[% l.branchname %]</i></legend>

<ol>
<li>
<label></label>
Times should be in 24-hour format ( 00:00 to 23:59 ).
</li>

<li>
<label>Sunday: </label>

<input name="pickup-start-hour-sunday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.sunday_start_hour %]" type="text">
<input name="pickup-start-hour-sunday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.sunday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-sunday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.sunday_start_minute %]" type="text">
<input name="pickup-start-minute-sunday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.sunday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-sunday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.sunday_end_hour %]" type="text">
<input name="pickup-end-hour-sunday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.sunday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-sunday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.sunday_end_minute %]" type="text">
<input name="pickup-end-minute-sunday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.sunday_end_minute) %]" type="text">
</li>

<li>
<label>Monday: </label>

<input name="pickup-start-hour-monday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.monday_start_hour %]" type="text">
<input name="pickup-start-hour-monday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.monday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-monday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.monday_start_minute %]" type="text">
<input name="pickup-start-minute-monday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.monday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-monday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.monday_end_hour %]" type="text">
<input name="pickup-end-hour-monday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.monday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-monday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.monday_end_minute %]" type="text">
<input name="pickup-end-minute-monday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.monday_end_minute) %]" type="text">
</li>

<li>
<label>Tuesday: </label>

<input name="pickup-start-hour-tuesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.tuesday_start_hour %]" type="text">
<input name="pickup-start-hour-tuesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.tuesday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-tuesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.tuesday_start_minute %]" type="text">
<input name="pickup-start-minute-tuesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.tuesday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-tuesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.tuesday_end_hour %]" type="text">
<input name="pickup-end-hour-tuesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.tuesday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-tuesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.tuesday_end_minute %]" type="text">
<input name="pickup-end-minute-tuesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.tuesday_end_minute) %]" type="text">
</li>

<li>
<label>Wednesday: </label>

<input name="pickup-start-hour-wednesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.wednesday_start_hour %]" type="text">
<input name="pickup-start-hour-wednesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.wednesday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-wednesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.wednesday_start_minute %]" type="text">
<input name="pickup-start-minute-wednesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.wednesday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-wednesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.wednesday_end_hour %]" type="text">
<input name="pickup-end-hour-wednesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.wednesday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-wednesday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.wednesday_end_minute %]" type="text">
<input name="pickup-end-minute-wednesday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.wednesday_end_minute) %]" type="text">
</li>

<li>
<label>Thursday: </label>

<input name="pickup-start-hour-thursday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.thursday_start_hour %]" type="text">
<input name="pickup-start-hour-thursday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.thursday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-thursday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.thursday_start_minute %]" type="text">
<input name="pickup-start-minute-thursday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.thursday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-thursday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.thursday_end_hour %]" type="text">
<input name="pickup-end-hour-thursday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.thursday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-thursday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.thursday_end_minute %]" type="text">
<input name="pickup-end-minute-thursday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.thursday_end_minute) %]" type="text">
</li>

<li>
<label>Friday: </label>

<input name="pickup-start-hour-friday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.friday_start_hour %]" type="text">
<input name="pickup-start-hour-friday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.friday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-friday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.friday_start_minute %]" type="text">
<input name="pickup-start-minute-friday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.friday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-friday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.friday_end_hour %]" type="text">
<input name="pickup-end-hour-friday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.friday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-friday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.friday_end_minute %]" type="text">
<input name="pickup-end-minute-friday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.friday_end_minute) %]" type="text">
</li>

<li>
<label>Saturday: </label>

<input name="pickup-start-hour-saturday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.saturday_start_hour %]" type="text">
<input name="pickup-start-hour-saturday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.saturday_start_hour) %]" type="text">
:
<input name="pickup-start-minute-saturday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.saturday_start_minute %]" type="text">
<input name="pickup-start-minute-saturday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.saturday_start_minute) %]" type="text">

to

<input name="pickup-end-hour-saturday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.saturday_end_hour %]" type="text">
<input name="pickup-end-hour-saturday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.saturday_end_hour) %]" type="text">
:
<input name="pickup-end-minute-saturday-[% branchcode | html %]" size="3" value="[% policies.$branchcode.saturday_end_minute %]" type="text">
<input name="pickup-end-minute-saturday-[% branchcode | html %]" size="3" value="[% minutes_format(m=policies.$branchcode.saturday_end_minute) %]" type="text">
</li>
</ol>
</fieldset>
Expand Down

0 comments on commit c118114

Please sign in to comment.