You're Invited: Meet the Socket team at BSidesSF and RSAC - April 27 - May 1.RSVP
Socket
Sign inDemoInstall
Socket

@shelf/datetime

Package Overview
Dependencies
Maintainers
53
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.2.18
npm
Version published
Weekly downloads
16K
12.41%
Maintainers
53
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 20 Oct 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