mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-04-30 01:09:29 +00:00
(js) Fix exception in Card service
When calling init from $reset, the birthday attribute is already a Date object. Avoid raising an exception on wrong data type.
This commit is contained in:
@@ -174,7 +174,7 @@
|
||||
_this.refs[i] = new Card(o);
|
||||
});
|
||||
// Instanciate date object of birthday
|
||||
if (this.birthday) {
|
||||
if (this.birthday && angular.isString(this.birthday)) {
|
||||
var dlp = Card.$Preferences.$mdDateLocaleProvider;
|
||||
this.birthday = this.birthday.parseDate(dlp, '%Y-%m-%d');
|
||||
this.$birthday = dlp.formatDate(this.birthday);
|
||||
|
||||
Reference in New Issue
Block a user