Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TASK] Replace moment with luxon #20

Merged
merged 4 commits into from
Mar 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 28 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Custom Home Assistant card displaying a responsive overview of multiple days wit
- [Calendars](#calendars)
- [Texts](#texts)
- [Weather](#weather)
- [Example](#example)
- [Examples](#examples)

## Installation

Expand Down Expand Up @@ -52,20 +52,20 @@ Custom Home Assistant card displaying a responsive overview of multiple days wit

### Main Options

| Name | Type | Default | Supported options | Description |
|--------------------|-------------|----------------------------------------------------|------------------------------------------------------------------------|------------------------------------------------|
| `type` | string | **Required** | `custom:week-planner-card` | Type of the card |
| `days` | number | 7 | Any positive integer number | The number of days to show |
| `noCardBackground` | boolean | false | `false` \| `true` | Do not show default card background and border |
| `eventBackground` | string | `var(--card-background-color, inherit)` | Any CSS color | Background color of the events |
| `updateInterval` | number | 60 | Any positive integer number | Seconds between checks for new events |
| `calendars` | object list | **Required** | See [Calendars](#calendars) | Calendars shown in this card |
| `texts` | object list | {} | See [Texts](#texts) | Texts used in the card |
| `weather` | object | optional | See [Weather](#weather) | Configuration for optional weather forecast |
| `dateFormat` | string | `dddd DD MMMM YYYY` | See [Moment.js format](https://momentjs.com/docs/#/displaying/format/) | Format of the date in event details |
| `timeFormat` | string | `HH:mm` | See [Moment.js format](https://momentjs.com/docs/#/displaying/format/) | Format of the time |
| `locale` | string | `en` | Any locale string supported by Moment.js | Locale used for day and month texts |
| `locationLink` | string | `https://www.google.com/maps/search/?api=1&query=` | Any URL | Link used for event location |
| Name | Type | Default | Supported options | Description |
|--------------------|-------------|----------------------------------------------------|-----------------------------------------------------------------|------------------------------------------------|
| `type` | string | **Required** | `custom:week-planner-card` | Type of the card |
| `days` | number | 7 | Any positive integer number | The number of days to show |
| `noCardBackground` | boolean | false | `false` \| `true` | Do not show default card background and border |
| `eventBackground` | string | `var(--card-background-color, inherit)` | Any CSS color | Background color of the events |
| `updateInterval` | number | 60 | Any positive integer number | Seconds between checks for new events |
| `calendars` | object list | **Required** | See [Calendars](#calendars) | Calendars shown in this card |
| `texts` | object list | {} | See [Texts](#texts) | Texts used in the card |
| `weather` | object | optional | See [Weather](#weather) | Configuration for optional weather forecast |
| `dateFormat` | string | `cccc d LLLL yyyy` | See [Luxon format](https://moment.github.io/luxon/#/formatting) | Format of the date in event details |
| `timeFormat` | string | `HH:mm` | See [Luxon format](https://moment.github.io/luxon/#/formatting) | Format of the time |
| `locale` | string | `en` | Any locale string supported by Luxon | Locale used for day and month texts |
| `locationLink` | string | `https://www.google.com/maps/search/?api=1&query=` | Any URL | Link used for event location |

### Calendars

Expand Down Expand Up @@ -99,7 +99,17 @@ Custom Home Assistant card displaying a responsive overview of multiple days wit
| `showTemperature` | boolean | false | `false` \| `true` | Show temperature |
| `showLowTemperature` | boolean | false | `false` \| `true` | Show low temperature |

## Example
## Examples

### Minimal

```yaml
type: custom:week-planner-card
calendars:
- entity: calendar.my_calendar_1
```

### Extended

```yaml
type: custom:week-planner-card
Expand All @@ -115,16 +125,11 @@ weather:
days: 14
noCardBackground: true
eventBackground: rgba(0, 0, 0, .75)
locationLink: https://www.openstreetmap.org/search?query=
locale: nl
texts:
noEvents: Geen activiteiten
fullDay: Hele dag
today: Vandaag
sunday: Zondag
monday: Maandag
tuesday: Dinsdag
wednesday: Woensdag
thursday: Donderdag
friday: Vrijdag
saturday: Zaterdag
tomorrow: Morgen
```
39 changes: 9 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
},
"dependencies": {
"lit": "^3.1.2",
"moment": "^2.30.1"
"luxon": "^3.4.4"
}
}
Loading
Loading