mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-05 11:13:18 +00:00
Fix calendar events not using minutes
This commit is contained in:
parent
6acb97df79
commit
e94ed17de9
1 changed files with 6 additions and 4 deletions
|
@ -82,13 +82,15 @@ export component Calendar inherits Rectangle {
|
|||
}
|
||||
if day.date == root.current-date : Rectangle {
|
||||
background: Palette.red;
|
||||
x: 0px;
|
||||
x: 1px;
|
||||
y: day-start-y + hour-spacing * root.current-time.hour + (root.current-time.minute / 60 * hour-spacing);
|
||||
width: parent.width;
|
||||
width: parent.width - 1px;
|
||||
height: 1px;
|
||||
z: 100;
|
||||
}
|
||||
for event[event-index] in day.events : Rectangle {
|
||||
private property <length> start-point: day-start-y + hour-spacing * event.starts_at.hour + hour-spacing * (event.starts-at.minute / 60);
|
||||
private property <int> duration: (event.ends-at.hour * 60 + event.ends-at.minute) - (event.starts-at.hour * 60 + event.starts-at.minute);
|
||||
Rectangle {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
|
@ -99,8 +101,8 @@ export component Calendar inherits Rectangle {
|
|||
border-radius: 4px;
|
||||
x: 8px;
|
||||
width: parent.width - 16px;
|
||||
y: day-start-y + hour-spacing * event.starts_at.hour;
|
||||
height: hour-spacing * (event.ends_at.hour - event.starts_at.hour) - 2px;
|
||||
y: start-point;
|
||||
height: hour-spacing * (duration / 60) - 2px;
|
||||
clip: true;
|
||||
HorizontalLayout {
|
||||
Rectangle {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue