mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fix due date when no time in certain timezones (#19280)
* Fix due date when no time in certain timezones * Update dialog-todo-item-editor.ts
This commit is contained in:
parent
a1cf18468b
commit
a31b9f1b4d
@ -335,7 +335,7 @@ export class HuiTodoListCard extends LitElement implements LovelaceCard {
|
||||
const due = item.due
|
||||
? item.due.includes("T")
|
||||
? new Date(item.due)
|
||||
: endOfDay(new Date(item.due))
|
||||
: endOfDay(new Date(`${item.due}T00:00:00`))
|
||||
: undefined;
|
||||
const today =
|
||||
due && !item.due!.includes("T") && isSameDay(new Date(), due);
|
||||
|
@ -60,8 +60,10 @@ class DialogTodoItemEditor extends LitElement {
|
||||
this._checked = entry.status === TodoItemStatus.Completed;
|
||||
this._summary = entry.summary;
|
||||
this._description = entry.description || "";
|
||||
this._due = entry.due ? new Date(entry.due) : undefined;
|
||||
this._hasTime = entry.due?.includes("T") || false;
|
||||
this._due = entry.due
|
||||
? new Date(this._hasTime ? entry.due : `${entry.due}T00:00:00`)
|
||||
: undefined;
|
||||
} else {
|
||||
this._hasTime = false;
|
||||
this._checked = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user