angular - Converting mysql date to js date works in chrome but not safari -
i using pipe in angular2 convert mysql date js date format here code:
export class datetoiso { transform(value) { let date = new date(value); let str = (date.getmonth() + 1) + '.' + date.getdate() + '.' + date.getfullyear() return str; } }
in html use {{ post[2] | datetoiso}}
show converted date. in chrome correct datetime not in safari. returns nan.nan.nan
.
i had similar problem currency pipe , internationalization issue. wrote here http://blogs.msmvps.com/deborahk/angular-2-getting-started-problem-solver/
install international package: npm install intl@1.1.0 –save
include following in index.html:
(i'm using touch device , pasted code doesn't work. please see link)
Comments
Post a Comment