pipe of date angular
content_copy
{{ dateObj | date }} // output is 'Jun 15, 2015'
{{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
{{ dateObj | date:'shortTime' }} // output is '9:43 PM'
{{ dateObj | date:'mm:ss' }} // output is '43:11'
import { DatePipe } from '@angular/common'
...
constructor(public datepipe: DatePipe){}
...
myFunction(){
this.date=new Date();
let latest_date =this.datepipe.transform(this.date, 'yyyy-MM-dd');
}import { DatePipe } from '@angular/common'
...
providers: [DatePipe]
Also in JavaScript:
- how to cause a whole page reload react redux
- angular viewchild input element value
- ec2 yum nodejs
- local storage javascript array
- page not found on netlify with react router
- electron remove cors
- truncate function react
- js promise examples
- try catch javascript
- js start with
- js change video src
- javascript destructing
- settimeout in angular
- react search bar
- firebase react js
- node console showing object object
- null is object in javascript
- nativescript absolutelayout bottom
- detect browser javascript
- how to call function from another js file in react native
- get start of day javascript
- how to console.log nested objects js
- Underscore.js
- dropdown validation using jquery