We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use momentjs just in code? Not in templates.
The text was updated successfully, but these errors were encountered:
All pipes implement PipeTransform which has method transform(value: any, ...args: any[]). You can use it like this:
PipeTransform
transform(value: any, ...args: any[])
let a = new Date(); let b = (new DateFormatPipe()).transform(a, 'YYYY-MM-DD HH:mm'); console.log(a); console.log(b);
Will output
Wed Aug 09 2017 19:52:18 GMT+0300 (Russia TZ 2 Standard Time) 2017-08-09 19:52
Also instead of creating a new instance you can provide pipe in parent module and inject in constructor (just like a service).
Don't forget to:
import { DateFormatPipe } from 'angular2-moment';
Sorry, something went wrong.
How do you amUtc from code?
No branches or pull requests
How to use momentjs just in code? Not in templates.
The text was updated successfully, but these errors were encountered: