Retain event data when moving/resizing schedule item (#23621)

* Retain event data when moving/resizing schedule item

* update from suggestion
This commit is contained in:
karwosts 2025-01-08 06:08:16 -08:00 committed by GitHub
parent b1acf9a057
commit f75f4b9733
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -296,6 +296,7 @@ class HaScheduleForm extends LitElement {
const endFormatted = formatTime24h(end, this.hass.locale, this.hass.config); const endFormatted = formatTime24h(end, this.hass.locale, this.hass.config);
newValue[day][index] = { newValue[day][index] = {
...newValue[day][index],
from: value.from, from: value.from,
to: to:
!isSameDay(start, end) || endFormatted === "0:00" !isSameDay(start, end) || endFormatted === "0:00"
@ -322,6 +323,7 @@ class HaScheduleForm extends LitElement {
const endFormatted = formatTime24h(end, this.hass.locale, this.hass.config); const endFormatted = formatTime24h(end, this.hass.locale, this.hass.config);
const event = { const event = {
...newValue[day][index],
from: formatTime24h(start, this.hass.locale, this.hass.config), from: formatTime24h(start, this.hass.locale, this.hass.config),
to: to:
!isSameDay(start, end) || endFormatted === "0:00" !isSameDay(start, end) || endFormatted === "0:00"