0.0.9 • Published 2 years ago

ngx-round-date v0.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

ngx-round-date

npm version npm downloads

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

  1. Install ngx-round-date through npm package manager using the following command:

    npm i ngx-round-date --save
  2. 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 {
    }
  3. 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)

0.0.9

2 years ago

0.0.8

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago