mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-23 17:26:42 +00:00
Read correctly the minutes of a schedule (#13929)
This commit is contained in:
parent
b9395e1c97
commit
2a6ef9b955
@ -219,19 +219,18 @@ class HaScheduleForm extends LitElement {
|
||||
|
||||
const start = new Date();
|
||||
start.setDate(start.getDate() + distance);
|
||||
const start_tokens = item.from.split(":");
|
||||
start.setHours(
|
||||
parseInt(item.from.slice(0, 2)),
|
||||
parseInt(item.from.slice(-2))
|
||||
parseInt(start_tokens[0]),
|
||||
parseInt(start_tokens[1]),
|
||||
0,
|
||||
0
|
||||
);
|
||||
|
||||
const end = new Date();
|
||||
end.setDate(end.getDate() + distance);
|
||||
end.setHours(
|
||||
parseInt(item.to.slice(0, 2)),
|
||||
parseInt(item.to.slice(-2)),
|
||||
0,
|
||||
0
|
||||
);
|
||||
const end_tokens = item.to.split(":");
|
||||
end.setHours(parseInt(end_tokens[0]), parseInt(end_tokens[1]), 0, 0);
|
||||
|
||||
events.push({
|
||||
id: `${day}-${index}`,
|
||||
|
Loading…
x
Reference in New Issue
Block a user