Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

datie

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datie

Small template string based date formatter for the browser and Node.js.

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by600%
Maintainers
1
Weekly downloads
 
Created
Source

🗓 Datie

Small template string based date formatter for the browser and Node.js.

Follows https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table with the inclusion of o suffix to enable eg. 1st, 2nd etc.

Usage

Datie takes the format as a tagged template function and then returns a function which accepts the date or a new Date compatible string.

import datie from 'datie'

const string = "2020-05-13T08:34:30.911Z"
const date = new Date(string)

datie`d/M-y hh:mm`(string) // 13/5-2020 08:34

// or

datie`d/M-y hh:mm`(date) // 13/5-2020 08:34

FAQs

Package last updated on 01 May 2024

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