Add hour when days don't match GODT-655

This commit is contained in:
Jakub
2020-08-23 10:04:52 +02:00
committed by Michal Horejsek
parent 2d9417d501
commit 61867fbde7
2 changed files with 11 additions and 2 deletions

View File

@ -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(),