Fix Date creation for timezone with change at midnight
Fixing https://bugs.launchpad.net/openerp-web/+bug/1068105 review1281002
This commit is contained in:
1 parent
95f07565b9
commit
8d5bc95d33
1 file changed
+7
@@ -76,7 +76,14 @@ var Sao = {};
|
||||
date = new Date(year, month, day);
|
||||
}
|
||||
date.isDate = true;
|
||||
var previous_day = date.getDate();
|
||||
var previous_hour = date.getHours();
|
||||
date.setHours(0);
|
||||
// Setting hours could change the day due to local timezone
|
||||
if (previous_day != date.getDate()) {
|
||||
date.setDate(previous_day);
|
||||
date.setHours(previous_hour);
|
||||
}
|
||||
date.setMinutes(0);
|
||||
date.setSeconds(0);
|
||||
date.setMilliseconds(0);
|
||||
|
||||
Reference in new issue
Block a user