From e590aec64fc73592fc4c92e34b54421ceeadc4be Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Fri, 15 Dec 2017 16:36:15 -0500 Subject: [PATCH] (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. --- UI/WebServerResources/js/Contacts/Card.service.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/UI/WebServerResources/js/Contacts/Card.service.js b/UI/WebServerResources/js/Contacts/Card.service.js index f396f1441..00fbac211 100644 --- a/UI/WebServerResources/js/Contacts/Card.service.js +++ b/UI/WebServerResources/js/Contacts/Card.service.js @@ -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);