mirror of
https://github.com/Lissy93/dashy.git
synced 2024-12-24 17:34:17 +03:00
🔀 Merge pull request #1192 from BhasherBEL/master
Add lang option for public holidays
This commit is contained in:
commit
3c25fb8494
@ -709,6 +709,7 @@ Counting down to the next day off work? This widget displays upcoming public hol
|
||||
**`state`** | `string` | **Optional** | restrict a country to a specific state defined by [ISO_3166-2](https://en.wikipedia.org/wiki/ISO_3166-2), e.g. `LND`.
|
||||
**`holidayType`** | `string` | **Optional** | The type of holidays to fetch. Can be: `all`, `public_holiday`, `observance`, `school_holiday`, `other_day` or `extra_working_day`. Defaults to `public_holiday`
|
||||
**`monthsToShow`** | `number` | **Optional** | The number of months in advance to show. Min: `1`, max: `24`. Defaults to `12`
|
||||
**`lang`** | `string` | **Optional** | The language in which the events should be. Usually local languages and english are available. Default to first available in the country. e.g. `en` or `fr`.
|
||||
|
||||
#### Example
|
||||
|
||||
@ -719,6 +720,7 @@ Counting down to the next day off work? This widget displays upcoming public hol
|
||||
region: LND
|
||||
holidayType: all
|
||||
monthsToShow: 12
|
||||
lang: en
|
||||
```
|
||||
|
||||
#### Info
|
||||
|
@ -90,7 +90,7 @@ export default {
|
||||
const formatType = (ht) => capitalize(ht.replaceAll('_', ' '));
|
||||
holidays.forEach((holiday) => {
|
||||
results.push({
|
||||
name: holiday.name[0].text,
|
||||
name: holiday.name.filter(p => p.lang == this.options.lang)[0].text || holiday.name[0].text,
|
||||
date: makeDate(holiday.date),
|
||||
type: formatType(holiday.holidayType),
|
||||
observed: holiday.observedOn ? makeDate(holiday.observedOn) : '',
|
||||
|
Loading…
Reference in New Issue
Block a user