From a731013a8cbd5b12a3febce56cf740f75041e68c Mon Sep 17 00:00:00 2001 From: miruka Date: Sat, 7 Sep 2019 16:33:16 -0400 Subject: [PATCH] Fix Utils.minutesBetween() minutesBetween( new Date(2019, 01, 01, 13, 20, 00), new Date(2019, 01, 01, 14, 20, 00) ) returned 0 instead of 60, the fixed function property return numbers of minutes after 60. --- TODO.md | 3 +-- src/qml/utils.js | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/TODO.md b/TODO.md index 83ae8d0e..71d36f3a 100644 --- a/TODO.md +++ b/TODO.md @@ -8,10 +8,9 @@ - Is auto-sizing actually needed, or can we just set a default manual size? - Reducable room sidepane, swipe to show full-window - - When qml syntax highlighting supports ES6 string interpolation, use them + - When qml syntax highlighting supports ES6 string interpolation, use that - Fixes - - `minutesBetween()` for 13:13:58 and 14:15:07 - Pressing backspace in composer sometimes doesn't work - Message order isn't preserved when sending a first message in a E2E room, then while keys are being shared sending one with another account, diff --git a/src/qml/utils.js b/src/qml/utils.js index 5fcf5384..e97bc285 100644 --- a/src/qml/utils.js +++ b/src/qml/utils.js @@ -125,7 +125,7 @@ function thumbnailParametersFor(width, height) { function minutesBetween(date1, date2) { - return Math.round((((date2 - date1) % 86400000) % 3600000) / 60000) + return ((date2 - date1) / 1000) / 60 }