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/

  1. install international package: npm install intl@1.1.0 –save

  2. include following in index.html:

(i'm using touch device , pasted code doesn't work. please see link)


Comments

Popular posts from this blog

ios - RestKit 0.20 — CoreData: error: Failed to call designated initializer on NSManagedObject class (again) -

java - Digest auth with Spring Security using javaconfig -

laravel - PDOException in Connector.php line 55: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) -