ngx-round-date
v0.0.9
Published
[![npm version](https://badge.fury.io/js/ngx-round-date.svg)](http://badge.fury.io/js/ngx-round-date) [![npm downloads](https://img.shields.io/npm/dm/ngx-round-date.svg)](https://npmjs.org/ngx-round-date)
Downloads
4
Readme
ngx-round-date
Simple round-date pipe
- Compatible with Angular version 12.2.0
Example
Code:
this.testDate=new Date(2022,12,31,23,59,59);
Template:
<span>{{testDate | roundDate}}</span>
It displays:
01/02/2023 00:00:00
Usage
Install ngx-round-date through npm package manager using the following command:
npm i ngx-round-date --save
Add RoundDatePipeModule into your AppModule class. app.module.ts would look like this:
import {NgModule} from '@angular/core'; import {BrowserModule} from '@angular/platform-browser'; import {AppComponent} from './app.component'; import { RoundDatePipeModule } from 'ngx-round-date'; @NgModule({ imports: [BrowserModule, RoundDatePipeModule], declarations: [AppComponent], bootstrap: [AppComponent], }) export class AppModule { }
Add the pipe into html (default round 5 minutes)
<span>{{testDate | roundDate}}</span>
or
<span>{{testDate | roundDate:10}}</span>
License
The MIT License (see the LICENSE file for the full text)