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

@shelf/datetime

Package Overview
Dependencies
Maintainers
54
Versions
150
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shelf/datetime

Shelf dates library

  • 0.1.27
  • npm
  • Socket score

Version published
Weekly downloads
12K
increased by17.93%
Maintainers
54
Weekly downloads
 
Created
Source

Shelf DateTime

Migration from @shelf/dates to @shelf/datetime - https://gemshelf.atlassian.net/wiki/spaces/PD/pages/3588980797/Migration+from+shelf+dates+to+shelf+datetime+date-fns+-+dayjs

import {setGlobalLocale, formatDistance} from '@shelf/datetime';
// OR
import setGlobalLocale from '@shelf/datetime/lib/setGlobaleLocale';
import formatDistance from '@shelf/datetime/lib/formatDistance';

setGlobalLocale('uk'); // set non-default locale (default 'en')

formatDistance(
  new Date(1986, 3, 4, 10, 32, 0),
  new Date(1986, 3, 4, 10, 32, 20)
); // декілька секунд назад


setGlobalLocale('en');

formatDistance(
  new Date(1986, 3, 4, 10, 32, 0),
  new Date(1986, 3, 4, 10, 32, 20)
); // a few seconds ago

FAQs

Package last updated on 19 Aug 2022

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