dayjs-with-plugins

1.0.3 • Public • Published

dayjs-with-plugins

build status code style styled with prettier made with lass license npm downloads

Day.js with all plugins and locales added out of the box, no need to use dayjs.extend nor dayjs.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://polyfill.io/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://polyfill.io (specifically with the bundle mentioned in VanillaJS above):

<script src="https://polyfill.io/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/

License

MIT © Nick Baugh

Package Sidebar

Install

npm i dayjs-with-plugins

Weekly Downloads

1,708

Version

1.0.3

License

MIT

Unpacked Size

705 kB

Total Files

7

Last publish

Collaborators

  • niftylettuce
  • titanism