This commit is contained in:
Borna Rajković 2024-08-08 14:02:45 +02:00
parent b4288b2abb
commit b2646e5aa1
3 changed files with 19 additions and 16 deletions

View File

@ -28,25 +28,25 @@ That endpoint accepts a list of required and optional parameters
- if defined year and rangeStart|rangeEnd parameters are ignored
`rangeStart|rangeEnd`
`range_start|range_end`
- returns holidays in given range with both ends being inclusive
- if either limit isn't defined it is assumed to be up to or all from given limit (if rangeStart isn't defined all holidays before rangeEnd are returned and vice-verse)
- dates must be formatted in ISO 8601 format [more info here](https://www.iso.org/iso-8601-date-and-time-format.html)
- eg. `rangeStart=2021-12-25&rangeEnd=2023-01-23`, `rangeStart=2023-01-20`
- eg. `range_start=2021-12-25&range_end=2023-01-23`, `range_start=2023-01-20`
- if defined year parameter is ignored
`stateHoliday`
`state_holiday`
- if set true only holidays that are tagged as state holidays are returned, similar for if set false, if not set all holidays are returned
- eg. `stateHoliday=true`, `stateHoliday=false`
- eg. `state_holiday=true`, `state_holiday=false`
`religiousHoliday`
`religious_holiday`
- if set true only holidays that are tagged as religious holidays are returned, similar for if set false, if not set all holidays are returned
- eg. `religiousHoliday=true`, `religiousHoliday=false`
- eg. `religious_holiday=true`, `religious_holiday=false`
#### Paging
`pageSize`
`page_size`
- returns at most pageSize number of holidays
- eg. `pageSize=20`
- eg. `page_size=20`
- only applied if page is defined as well, by default set to 20
`page`

View File

@ -44,10 +44,10 @@ window.addEventListener('load', () => {
query['country'] = country.value;
query['contentType'] = contentType.value;
if(stateHoliday.value === 'true' || stateHoliday.value === 'false') {
query['stateHoliday'] = parseBoolean(stateHoliday.value);
query['state_holiday'] = parseBoolean(stateHoliday.value);
}
if(religiousHoliday.value === 'true' || religiousHoliday.value === 'false') {
query['religiousHoliday'] = parseBoolean(religiousHoliday.value);
query['religious_holiday'] = parseBoolean(religiousHoliday.value);
}
console.log(dateSelector.value, dStartRange.value, dEndRange.value);
switch(dateSelector.value) {
@ -61,10 +61,10 @@ window.addEventListener('load', () => {
break;
case 'range':
if(dStartRange.value) {
query['startRange'] = dStartRange.value;
query['range_start'] = dStartRange.value;
}
if(dEndRange.value) {
query['endRange'] = dEndRange.value;
query['range_end'] = dEndRange.value;
}
case 'all':
default:
@ -78,10 +78,10 @@ window.addEventListener('load', () => {
query['country'] = country.value;
query['type'] = contentType.value;
if(stateHoliday.value === 'true' || stateHoliday.value === 'false') {
query['stateHoliday'] = parseBoolean(stateHoliday.value);
query['state_holiday'] = parseBoolean(stateHoliday.value);
}
if(religiousHoliday.value === 'true' || religiousHoliday.value === 'false') {
query['religiousHoliday'] = parseBoolean(religiousHoliday.value);
query['religious_holiday'] = parseBoolean(religiousHoliday.value);
}
console.log(dateSelector.value, dStartRange.value, dEndRange.value);
switch(dateSelector.value) {
@ -95,10 +95,10 @@ window.addEventListener('load', () => {
break;
case 'range':
if(dStartRange.value) {
query['startRange'] = dStartRange.value;
query['range_start'] = dStartRange.value;
}
if(dEndRange.value) {
query['endRange'] = dEndRange.value;
query['range_end'] = dEndRange.value;
}
case 'all':
default:

3
changelog.md Normal file
View File

@ -0,0 +1,3 @@
### v1.0.1
* Updated api documentation page
* Updated README.md