From 780dd65c88fb124825f834a7aa8d557eb44e60d4 Mon Sep 17 00:00:00 2001 From: Denys Vuika Date: Mon, 20 Jun 2016 17:10:24 +0100 Subject: [PATCH] Fix crashing on Safari/FF for date conversion --- .../src/components/document-list.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts index fbba7a814e..82ccd4b3fd 100644 --- a/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts +++ b/ng2-components/ng2-alfresco-documentlist/src/components/document-list.ts @@ -447,11 +447,11 @@ export class DocumentList implements OnInit, AfterViewChecked, AfterContentInit, if (col.type === 'date') { let datePipe = new DatePipe(); - // TODO: review when angular 2 is released - // .supports has been marked as private in RC2 - // if (datePipe.supports(value)) { - return datePipe.transform(value, col.format); - // } + try { + return datePipe.transform(value, col.format); + } catch (err) { + console.error(`DocumentList: error parsing date ${value} to format ${col.format}`); + } } if (col.type === 'image') {