From 61867fbde7431b96da839796cbe0a6b77642eb1a Mon Sep 17 00:00:00 2001 From: Jakub Date: Sun, 23 Aug 2020 10:04:52 +0200 Subject: [PATCH] Add hour when days don't match GODT-655 --- Changelog.md | 3 +++ internal/frontend/qml/ImportExportUI/DateInput.qml | 10 ++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Changelog.md b/Changelog.md index 5fd820b2..54f469a8 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,8 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/) ## Unreleased +## [IE 0.2.x] Congo + ### Added * GODT-633 Persistent anonymous API cookies for better load balancing and abuse detection. @@ -49,6 +51,7 @@ Changelog [format](http://keepachangelog.com/en/1.0.0/) * Structure for transfer rules in QML ### Fixed +* GODT-655 Fix date picker with automatic Windows DST * GODT-454 Fix send on closed channel when receiving unencrypted send confirmation from GUI. * GODT-597 Duplicate sending when draft creation takes too long diff --git a/internal/frontend/qml/ImportExportUI/DateInput.qml b/internal/frontend/qml/ImportExportUI/DateInput.qml index 7292eb5d..b88a16bb 100644 --- a/internal/frontend/qml/ImportExportUI/DateInput.qml +++ b/internal/frontend/qml/ImportExportUI/DateInput.qml @@ -247,8 +247,14 @@ Rectangle { if (!isNaN(parseInt(dayInput.currentText))) { day = Math.min(day, parseInt(dayInput.currentText)) } - currentString = [ yearInput.currentText, monthInput.currentText, day].join("-") - currentUnix = Date.fromLocaleDateString( locale, currentString, "yyyy-MMM-d").getTime() + var month = gui.allMonths.indexOf(monthInput.currentText) + var year = parseInt(yearInput.currentText) + var pickedDate = new Date(year, month, day) + // Compensate automatic DST in windows + if (pickedDate.getDate() != day) { + pickedDate.setTime(pickedDate.getTime() + 60*60*1000) // add hour + } + currentUnix = pickedDate.getTime() } return new Date(Math.max( minDate.getTime(),