Bug 362496 Fail more gracefully if we can't parse the date during csv import r=ctalbert,mvl

This commit is contained in:
jminta%gmail.com 2006-12-21 04:35:14 +00:00
Родитель f5d2ef4903
Коммит 878e848ad7
1 изменённых файлов: 7 добавлений и 1 удалений

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

@ -274,7 +274,9 @@ function csv_importFromStream(aStream, aCount) {
.createInstance(Components.interfaces.calIEvent); .createInstance(Components.interfaces.calIEvent);
event.title = title; event.title = title;
sDate.isDate = (locale.valueTrue == eventFields[args.allDayIndex]); if (sDate) {
sDate.isDate = (locale.valueTrue == eventFields[args.allDayIndex]);
}
if (locale.valueTrue == eventFields[args.privateIndex]) if (locale.valueTrue == eventFields[args.privateIndex])
event.privacy = "PRIVATE"; event.privacy = "PRIVATE";
@ -353,6 +355,10 @@ function parseDateTime(aDate, aTime, aLocale)
var rd = aLocale.dateRe.exec(aDate); var rd = aLocale.dateRe.exec(aDate);
var rt = aLocale.timeRe.exec(aTime); var rt = aLocale.timeRe.exec(aTime);
if (!rd || !rt) {
return null;
}
date.year = rd[aLocale.dateYearIndex]; date.year = rd[aLocale.dateYearIndex];
date.month = rd[aLocale.dateMonthIndex] - 1; date.month = rd[aLocale.dateMonthIndex] - 1;