mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-16 22:06:50 +00:00
Add time to today_at() functions (#34310)
This commit is contained in:
parent
c5b7d5048f
commit
d0f995c86f
@ -172,7 +172,7 @@ Here are some examples of periods you could work with, and what to write in your
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
start: "{{ today_at() }}"
|
||||
start: "{{ today_at('00:00') }}"
|
||||
end: "{{ now() }}"
|
||||
```
|
||||
|
||||
@ -183,7 +183,7 @@ Here are some examples of periods you could work with, and what to write in your
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
end: "{{ today_at() }}"
|
||||
end: "{{ today_at('00:00') }}"
|
||||
duration:
|
||||
hours: 24
|
||||
```
|
||||
@ -209,7 +209,7 @@ Here, last Monday is today at 00:00, minus the current weekday (the weekday is 0
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
start: "{{ today_at() - timedelta(days=now().weekday()) }}"
|
||||
start: "{{ today_at('00:00') - timedelta(days=now().weekday()) }}"
|
||||
end: "{{ now() }}"
|
||||
```
|
||||
|
||||
@ -220,7 +220,7 @@ Here, last Monday is today at 00:00, minus the current weekday (the weekday is 0
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
start: "{{ today_at().replace(day=1) }}"
|
||||
start: "{{ today_at('00:00').replace(day=1) }}"
|
||||
end: "{{ now() }}"
|
||||
```
|
||||
|
||||
@ -231,8 +231,8 @@ Here, last Monday is today at 00:00, minus the current weekday (the weekday is 0
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
start: "{{ (today_at().replace(day=1) - timedelta(days=1)).replace(day=1) }}"
|
||||
end: "{{ today_at().replace(day=1) }}"
|
||||
start: "{{ (today_at('00:00').replace(day=1) - timedelta(days=1)).replace(day=1) }}"
|
||||
end: "{{ today_at('00:00').replace(day=1) }}"
|
||||
```
|
||||
|
||||
{% endraw %}
|
||||
@ -254,7 +254,7 @@ Here, last Monday is today at 00:00, minus the current weekday (the weekday is 0
|
||||
{% raw %}
|
||||
|
||||
```yaml
|
||||
end: "{{ today_at() }}"
|
||||
end: "{{ today_at('00:00') }}"
|
||||
duration:
|
||||
days: 30
|
||||
```
|
||||
|
Loading…
x
Reference in New Issue
Block a user