Calendar hour fix (#2151)

Signed-off-by: Denis Bykhov <80476319+BykhovDenis@users.noreply.github.com>
This commit is contained in:
Denis Bykhov 2022-06-27 19:59:53 +06:00 committed by GitHub
parent c7e916abd1
commit c3d5c962cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -47,8 +47,8 @@
return `${(new Date(e.date).getMinutes() / 60) * 100}%`
}
function getHeight (e: Event): string {
if (e.dueDate !== undefined) {
function getHeight (e: Event, date: Date): string {
if (e.dueDate !== undefined && new Date(e.dueDate).getHours() === date.getHours()) {
return `${(new Date(e.dueDate).getMinutes() / 60) * 100}%`
}
return '100%'
@ -84,7 +84,7 @@
res += ` top: ${getTop(e)};`
}
if (endCell(e.dueDate ?? e.date, date)) {
res += ` height: ${getHeight(e)};`
res += ` height: ${getHeight(e, date)};`
}
return res
}