зеркало из https://github.com/mozilla/gecko-dev.git
Bug 879537 - Be more strict when setting Date properties of contacts. r=gwagner
--HG-- extra : rebase_source : 61741dc83d4b1e4ca0a9bd7bae070fcb1aed63d1
This commit is contained in:
Родитель
78fa900f98
Коммит
db0415d564
|
@ -417,7 +417,9 @@ Contact.prototype = {
|
|||
},
|
||||
|
||||
set bday(aBday) {
|
||||
if (aBday !== undefined && aBday !== null) {
|
||||
if (aBday instanceof Date) {
|
||||
this._bday = aBday;
|
||||
} else if (typeof aBday === "string" || typeof aBday === "number") {
|
||||
this._bday = new Date(aBday);
|
||||
}
|
||||
},
|
||||
|
@ -427,7 +429,9 @@ Contact.prototype = {
|
|||
},
|
||||
|
||||
set anniversary(aAnniversary) {
|
||||
if (aAnniversary !== undefined && aAnniversary !== null) {
|
||||
if (aAnniversary instanceof Date) {
|
||||
this._anniversary = aAnniversary;
|
||||
} else if (typeof aAnniversary === "string" || typeof aAnniversary === "number") {
|
||||
this._anniversary = new Date(aAnniversary);
|
||||
}
|
||||
},
|
||||
|
|
Загрузка…
Ссылка в новой задаче