Read correctly the minutes of a schedule (#13929)

This commit is contained in:
amitfin 2022-09-30 18:21:54 +03:00 committed by GitHub
parent b9395e1c97
commit 2a6ef9b955
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -219,19 +219,18 @@ class HaScheduleForm extends LitElement {
const start = new Date(); const start = new Date();
start.setDate(start.getDate() + distance); start.setDate(start.getDate() + distance);
const start_tokens = item.from.split(":");
start.setHours( start.setHours(
parseInt(item.from.slice(0, 2)), parseInt(start_tokens[0]),
parseInt(item.from.slice(-2)) parseInt(start_tokens[1]),
0,
0
); );
const end = new Date(); const end = new Date();
end.setDate(end.getDate() + distance); end.setDate(end.getDate() + distance);
end.setHours( const end_tokens = item.to.split(":");
parseInt(item.to.slice(0, 2)), end.setHours(parseInt(end_tokens[0]), parseInt(end_tokens[1]), 0, 0);
parseInt(item.to.slice(-2)),
0,
0
);
events.push({ events.push({
id: `${day}-${index}`, id: `${day}-${index}`,