Template:Open hours: Difference between revisions
From MoHA Wiki
No edit summary |
No edit summary |
||
(8 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
|Single day={{{Single day|}}} | |Single day={{{Single day|}}} | ||
|Range of days={{{Range day from|}}}–{{{Range day to|}}} | |Range of days={{{Range day from|}}}–{{{Range day to|}}} | ||
|Exact date={{#time: l, | |Exact date={{#time: l, F d{{#ifeq: {{#time:Y|{{{Exact date|}}}}}|{{CURRENTYEAR}}||, Y}}|{{{Exact date|}}}}} | ||
}}}}<!-- | }}}}<!-- | ||
-->{{#vardefine: checkW0|{{#ifeq:{{#time:a|{{{Hour open from|}}}:{{{Minutes open from|}}}:00}}|{{#time:a|{{{Hour open to|}}}:{{{Minutes open to|}}}:00}}||a}}}}<!-- | -->{{#vardefine: checkW0|{{#ifeq:{{#time:a|{{{Hour open from|00}}}:{{{Minutes open from|00}}}:00}}|{{#time:a|{{{Hour open to|00}}}:{{{Minutes open to|00}}}:00}}||a}}}}<!-- | ||
-->{{#vardefine: checkW1|{{#ifeq:{{#time:a|{{{Hour open from|}}}:{{{Minutes open from|}}}:00}}|{{#time:a|{{{Hour break from|}}}:{{{Minutes break from|}}}:00}}||a}}}}<!-- | -->{{#vardefine: checkW1|{{#ifeq:{{#time:a|{{{Hour open from|00}}}:{{{Minutes open from|00}}}:00}}|{{#time:a|{{{Hour break from|00}}}:{{{Minutes break from|00}}}:00}}||a}}}}<!-- | ||
-->{{#vardefine: checkW2|{{#ifeq:{{#time:a|{{{Hour open to|}}}:{{{Minutes open to|}}}:00}}|{{#time:a|{{{Hour break to|}}}:{{{Minutes break to|}}}:00}}||a}}}}<!-- | -->{{#vardefine: checkW2|{{#ifeq:{{#time:a|{{{Hour open to|00}}}:{{{Minutes open to|00}}}:00}}|{{#time:a|{{{Hour break to|00}}}:{{{Minutes break to|00}}}:00}}||a}}}}<!-- | ||
-->{{#vardefine: whours|{{#switch: {{{Schedule type|}}} | -->{{#vardefine: whours|{{#switch: {{{Schedule type|}}} | ||
|Without a break={{#time:g{{#if:{{{Minutes open from|}}}|{{#ifeq:{{{Minutes open from|}}}|00||:i}}}}{{#var:checkW0}}|{{{Hour open from|}}}:{{{Minutes open from|}}}:00}}–<!-- | |Without a break={{#time:g{{#if:{{{Minutes open from|00}}}|{{#ifeq:{{{Minutes open from|00}}}|00||:i}}}}{{#var:checkW0}}|{{{Hour open from|00}}}:{{{Minutes open from|00}}}:00}}–<!-- | ||
-->{{#time:g{{#if:{{{Minutes open to | -->{{#time:g{{#if:{{{Minutes open to|00}}}|{{#ifeq:{{{Minutes open to|00}}}|00||:i}}}}a|{{{Hour open to|00}}}:{{{Minutes open to|00}}}:00}} | ||
|With a break={{#time:g{{#if:{{{Minutes open from |}}}|{{#ifeq:{{{Minutes open from |}}}|00||:i}}}}{{#var:checkW1}}|{{{Hour open from |}}}:{{{Minutes open from |}}}:00}}–<!-- | |With a break={{#time:g{{#if:{{{Minutes open from|00}}}|{{#ifeq:{{{Minutes open from|00}}}|00||:i}}}}{{#var:checkW1}}|{{{Hour open from|00}}}:{{{Minutes open from|00}}}:00}}–<!-- | ||
-->{{#time:g{{#if:{{{Minutes break from|}}}|{{#ifeq:{{{Minutes break from|}}}|00||:i}}}}a|{{{Hour break from|}}}:{{{Minutes break from|}}}:00}}, <!-- | -->{{#time:g{{#if:{{{Minutes break from|00}}}|{{#ifeq:{{{Minutes break from|00}}}|00||:i}}}}a|{{{Hour break from|00}}}:{{{Minutes break from|00}}}:00}}, <!-- | ||
-->{{#time:g{{#if:{{{Minutes break to | -->{{#time:g{{#if:{{{Minutes break to|00}}}|{{#ifeq:{{{Minutes break to|00}}}|00||:i}}}}{{#var:checkW2}}|{{{Hour break to|00}}}:{{{Minutes break to|00}}}:00}}–<!-- | ||
-->{{#time:g{{#if:{{{Minutes open to | -->{{#time:g{{#if:{{{Minutes open to|00}}}|{{#ifeq:{{{Minutes open to|00}}}|00||:i}}}}a|{{{Hour open to|00}}}:{{{Minutes open to|00}}}:00}} | ||
}}}}<!-- | }}}}<!-- | ||
Line 30: | Line 30: | ||
--><li>{{#switch:{{{Record type|}}} | --><li>{{#switch:{{{Record type|}}} | ||
|Opening | |Opening | ||
|Closing=<div>'''{{{Record type|}}}'''</div> | |Closing=<div>'''{{{Label|{{{Record type|}}}}}}'''</div> | ||
| | |Regular=<div>'''{{{Label|Open hours}}}'''</div> | ||
|#default= | |#default='''{{{Label|}}}''' | ||
}} | }} | ||
<div>{{#var:wdays}}</div> | <div>{{#var:wdays}}</div> | ||
<div>{{#ifeq: {{{Record type|}}}|Day off|'''Day off'''|{{#var:whours}}}}</div> | <div>{{#ifeq: {{{Record type|}}}|Day off|'''Day off'''|{{#var:whours}}}}</div> | ||
</li></includeonly> | </li></includeonly> | ||
<noinclude> | |||
<templatedata> | |||
{ | |||
"params": { | |||
"Slot type": { | |||
"description": "Defines the type of time slot", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"Single day", | |||
"Range of days", | |||
"Exact date" | |||
], | |||
"default": "Exact date", | |||
"required": true, | |||
"suggested": true | |||
}, | |||
"Single day": { | |||
"description": "Name of a day of the week", | |||
"example": "Monday", | |||
"type": "string" | |||
}, | |||
"Range day from": { | |||
"description": "Name of the first day of the week in a range", | |||
"example": "Monday", | |||
"type": "string" | |||
}, | |||
"Range day to": { | |||
"description": "Name of the last day of the week in a range", | |||
"example": "Wednesday", | |||
"type": "string" | |||
}, | |||
"Exact date": { | |||
"description": "Date with a special schedule or meaning", | |||
"type": "date" | |||
}, | |||
"Hour open from": {}, | |||
"Minutes open from": {}, | |||
"Hour open to": {}, | |||
"Minutes open to": {}, | |||
"Hour break from": {}, | |||
"Minutes break from": {}, | |||
"Hour break to": {}, | |||
"Minutes break to": {}, | |||
"Schedule type": { | |||
"description": "Defines whether the schedule has a break", | |||
"suggestedvalues": [ | |||
"Without a break", | |||
"With a break" | |||
], | |||
"default": "Without a break" | |||
}, | |||
"Record type": { | |||
"description": "Defines a special meaning of the record", | |||
"type": "string", | |||
"suggestedvalues": [ | |||
"Opening", | |||
"Closing", | |||
"Day off", | |||
"Working day" | |||
], | |||
"default": "Working day" | |||
}, | |||
"Label": { | |||
"label": "Label for the record", | |||
"type": "string" | |||
} | |||
}, | |||
"paramOrder": [ | |||
"Slot type", | |||
"Single day", | |||
"Range day from", | |||
"Range day to", | |||
"Exact date", | |||
"Schedule type", | |||
"Record type", | |||
"Hour open from", | |||
"Minutes open from", | |||
"Hour open to", | |||
"Minutes open to", | |||
"Hour break from", | |||
"Minutes break from", | |||
"Hour break to", | |||
"Minutes break to", | |||
"Label" | |||
], | |||
"description": "The template tries to explain the event schedule. \n\nYou can set hours:\n* for the exact date (e.g., 05.10.2024, etc)\n* for the day of the week (e.g., Monday, etc)\n* for the range of days of the week (e.g., Monday-Friday, etc)\n\nYou can set any record as an Opening, Closing, or Day off. All other records are treated as Regular. \n\nIf there is a break in open hours, you can specify it, too. \n\nPlease note that hours are to be set in 24h format: the template will translate them into AM/PM." | |||
} | |||
</templatedata> | |||
</noinclude> |
Latest revision as of 10:40, June 18, 2024
The template tries to explain the event schedule. You can set hours:
- for the exact date (e.g., 05.10.2024, etc)
- for the day of the week (e.g., Monday, etc)
- for the range of days of the week (e.g., Monday-Friday, etc)
Parameter | Description | Type | Status | |
---|---|---|---|---|
Slot type | Slot type | Defines the type of time slot
| String | required |
Single day | Single day | Name of a day of the week
| String | optional |
Range day from | Range day from | Name of the first day of the week in a range
| String | optional |
Range day to | Range day to | Name of the last day of the week in a range
| String | optional |
Exact date | Exact date | Date with a special schedule or meaning | Date | optional |
Schedule type | Schedule type | Defines whether the schedule has a break
| Unknown | optional |
Record type | Record type | Defines a special meaning of the record
| String | optional |
Hour open from | Hour open from | no description | Unknown | optional |
Minutes open from | Minutes open from | no description | Unknown | optional |
Hour open to | Hour open to | no description | Unknown | optional |
Minutes open to | Minutes open to | no description | Unknown | optional |
Hour break from | Hour break from | no description | Unknown | optional |
Minutes break from | Minutes break from | no description | Unknown | optional |
Hour break to | Hour break to | no description | Unknown | optional |
Minutes break to | Minutes break to | no description | Unknown | optional |
Label for the record | Label | no description | String | optional |