Bug 485985 - test_history_sidebar should take in could DST correction when adding visits, r=dietrich

This commit is contained in:
Marco Bonardo 2009-03-30 23:07:38 +02:00
parent b90f4bc271
commit d57ee2ed3c

View File

@ -61,8 +61,11 @@ function add_normalized_visit(aURI, aTime, aDayOffset) {
dateObj.setMinutes(0);
dateObj.setSeconds(0);
dateObj.setMilliseconds(0);
// Days where DST changes should be taken in count.
var previousDateObj = new Date(dateObj.getTime() + aDayOffset * 86400000);
var DSTCorrection = (dateObj.getTimezoneOffset() - previousDateObj.getTimezoneOffset()) * 60 * 1000;
// Substract aDayOffset
var PRTimeWithOffset = (dateObj.getTime() + aDayOffset * 86400000) * 1000;
var PRTimeWithOffset = (previousDateObj.getTime() - DSTCorrection) * 1000;
print("Adding visit to " + aURI.spec + " at " + new Date(PRTimeWithOffset/1000));
var visitId = hs.addVisit(aURI,
PRTimeWithOffset,