bug 353725 - Fixes regression by moving UTC conversion inside the else block. r1/r2=dmose

This commit is contained in:
mattwillis%gmail.com 2006-09-22 04:12:16 +00:00
Родитель 74838dfd8a
Коммит 0086deb7e0
1 изменённых файлов: 9 добавлений и 2 удалений

Просмотреть файл

@ -189,11 +189,18 @@ function loadDialog()
setElementValue("repeat-ntimes-count", rule.count );
}
} else {
var endDate = rule.endDate.getInTimezone("UTC");
var endDate = rule.endDate;
if (!endDate) {
setElementValue("recurrence-duration", "forever");
} else {
// convert the datetime from UTC to localtime.
// rule.endDate is a floating datetime, however per RFC2445
// it must be in UTC. Since we want the datepicker to show
// the date based on our _local_ timezone, we must first
// "pin" the floating datetime to UTC, and then convert
// from UTC to our local timezone. We _can't_ simply
// convert directly from floating to our local timezone.
endDate = endDate.getInTimezone("UTC");
endDate = endDate.getInTimezone(calendarDefaultTimezone());
setElementValue("recurrence-duration", "until");
setElementValue("repeat-until-date", endDate.jsDate);