From 5cfd26361719e0cbef3dedda74c0a329c6483249 Mon Sep 17 00:00:00 2001 From: Zack Barett Date: Thu, 1 Sep 2022 11:06:51 -0500 Subject: [PATCH] Fix Sunday issue and add minutes to events (#13556) --- src/panels/config/helpers/forms/ha-schedule-form.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/panels/config/helpers/forms/ha-schedule-form.ts b/src/panels/config/helpers/forms/ha-schedule-form.ts index c3a02975b6..7955473ac3 100644 --- a/src/panels/config/helpers/forms/ha-schedule-form.ts +++ b/src/panels/config/helpers/forms/ha-schedule-form.ts @@ -178,7 +178,7 @@ class HaScheduleForm extends LitElement { }, eventTimeFormat: { hour: useAmPm(this.hass.locale) ? "numeric" : "2-digit", - minute: undefined, + minute: useAmPm(this.hass.locale) ? "numeric" : "2-digit", hour12: useAmPm(this.hass.locale), meridiem: useAmPm(this.hass.locale) ? "narrow" : false, }, @@ -214,7 +214,8 @@ class HaScheduleForm extends LitElement { } this[`_${day}`].forEach((item: ScheduleDay, index: number) => { - const distance = i - currentDay; + // Add 7 to 0 because we start the calendar on Monday + const distance = i - currentDay + (i === 0 ? 7 : 0); const start = new Date(); start.setDate(start.getDate() + distance);