SRS-Format-Date
Simple way to format your date with Pipe.
Table of Contents
Installation
$ npm i srs-format-date
Usage
To use SrsFormatDatePipe in your Angular project, import the SrsFormatDateModule into your module and add it to your template.For example, to use the formatdate
pipe:
In your app.module:
import { SrsFormatDateModule } from 'srs-format-date';
@NgModule({
// ...
imports: [
// ...
SrsFormatDateModule,
// ...
],
// ...
})
export class AppModule { }
In your component's template:
<p>{{ date | formatdate : arg1 : arg2 }}</p>
arg1
This is era, can be "AD" or "BE".
- "AD" = Anno Domini
- "BE" = Buddhist Era (+ 543 years)
arg2
Format of date output
Example
In your component's template:
<p>{{ date | formatdate : "AD" : "dd-MM-yyyy" }}</p>