Bug 362496 Fail more gracefully if we can't parse the date during csv import r=ctalbert,mvl
This commit is contained in:
Родитель
f5d2ef4903
Коммит
878e848ad7
|
@ -274,7 +274,9 @@ function csv_importFromStream(aStream, aCount) {
|
|||
.createInstance(Components.interfaces.calIEvent);
|
||||
|
||||
event.title = title;
|
||||
if (sDate) {
|
||||
sDate.isDate = (locale.valueTrue == eventFields[args.allDayIndex]);
|
||||
}
|
||||
if (locale.valueTrue == eventFields[args.privateIndex])
|
||||
event.privacy = "PRIVATE";
|
||||
|
||||
|
@ -354,6 +356,10 @@ function parseDateTime(aDate, aTime, aLocale)
|
|||
var rd = aLocale.dateRe.exec(aDate);
|
||||
var rt = aLocale.timeRe.exec(aTime);
|
||||
|
||||
if (!rd || !rt) {
|
||||
return null;
|
||||
}
|
||||
|
||||
date.year = rd[aLocale.dateYearIndex];
|
||||
date.month = rd[aLocale.dateMonthIndex] - 1;
|
||||
date.day = rd[aLocale.dateDayIndex];
|
||||
|
|
Загрузка…
Ссылка в новой задаче