dayjs-with-plugins
v1.0.4
Published
Day.js with all plugins and locales added out of the box, no need to use dayjs.extend nor dayjs.locale!
Downloads
6,220
Readme
dayjs-with-plugins
Day.js with all plugins and locales added out of the box, no need to use
dayjs.extend
nordayjs.locale
!
Table of Contents
Install
npm:
npm install dayjs dayjs-with-plugins
Usage
Node
const dayjs = require('dayjs-with-plugins');
console.log('M/D/YY', dayjs().format('M/D/YY'));
Browser
VanillaJS
This is the solution for you if you're just using <script>
tags everywhere!
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=Promise"></script>
<script src="https://unpkg.com/dayjs-with-plugins"></script>
<script type="text/javascript">
(function() {
console.log('M/D/YY', dayjs().format('M/D/YY'));
})();
</script>
Required Browser Features
We recommend using https://cdnjs.cloudflare.com/polyfill (specifically with the bundle mentioned in VanillaJS above):
<script src="https://cdnjs.cloudflare.com/polyfill/v3/polyfill.min.js?features=Promise"></script>
- Promise is not supported in op_mini all
Bundler
This assumes you are using browserify, webpack, rollup, or another bundler.
See Node usage above for how to use in a bundler environment.
Debugging
You can use NODE_DEBUG=dayjs-with-plugins node app.js
to debug output from this package.
Contributors
| Name | Website | | -------------- | -------------------------- | | Nick Baugh | http://niftylettuce.com/ |