New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-pretty-date

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-pretty-date

Angular js pipe for facebook, twitter like date time format, supports angular 8

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
27
increased by42.11%
Maintainers
1
Weekly downloads
 
Created
Source

Angular Pretty Date

Facebook, twitter like date conversion in Angular using angular pipes. Supports angular 8.

Check out the demo

Examples
InputOutput
Current timejust now
Till 60 seconds1 minute ago
2 to 59 minutesX minutes ago
60 minutes1 hour ago
2 to 23 hoursX hours ago
24 hoursYesterday
2 to 6 daysX days ago
7 days1 week ago
8 to 30 daysX weeks ago
30 days to 365 daysX months ago
more than 365 daysmore than a year ago
Date string 2019-12-24T06:18:445 weeks ago
Text StringInvalid Date

Getting Started

Install via npm

npm install --save ngx-pretty-date

Import the module
import { NgxPrettyDateModule } from 'ngx-pretty-date';

@NgModule({
  declarations: [
    ...
  ],
  imports: [
    ...
    NgxPrettyDateModule
  ],
  bootstrap: [...]
})
export class AppModule { }
Use in components
<span> {{dateObj | prettyDate}} </span>

You can pass javascript date object or string like this '2019-12-24T06:18:44'

Options

You can pass date format with the pipe example below

<span> {{dateObj | prettyDate:'dd/mm/yyyy'}} </span>

Valid formats are

  • dd/mm/yyyy
  • mm/dd/yyyy
  • yyyy/dd/mm
  • yyyy/mm/dd
Running the demo app
cd projectRoot
npm install
ng serve

Keywords

FAQs

Package last updated on 25 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc