Shelf/datetime
Shelf dates library
Install
$ yarn add @shelf/datetime
Usage
import {setGlobalLocale, formatDistance} from '@shelf/datetime';
import setGlobalLocale from '@shelf/datetime/lib/setGlobaleLocale';
import formatDistance from '@shelf/datetime/lib/formatDistance';
setGlobalLocale('uk');
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));
Publish
$ git checkout master
$ yarn version
$ yarn publish
$ git push origin master --tags
License
MIT © Shelf