@chettapong/moment-buddhist-era.js
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

Moment Buddhist Era

npm version npm downloads Github Actions CI Codecov License

Buddhist Era plugin for Moment.js

Features

  • Buddhist Era (B.E.) support

Setup

Browser

Grab the file as well as moment.js. Then simply reference Moment Buddhist Era after Moment:

<script src="moment.min.js"></script>
<script src="moment-buddhist-era.js"></script>

If you want to pull from a CDN, this one is automatically kept up to date.

Node.js

Add @chettapong/moment-buddhist-era.js dependency to your project

yarn add --dev @chettapong/moment-buddhist-era.js # or npm install --save-dev @chettapong/moment-buddhist-era.js
// CommonJS
var moment = require('moment');
require('@chettapong/moment-buddhist-era.js');
// ESM
import moment from 'moment';
import '@chettapong/moment-buddhist-era.js';

Usage

Format

moment('2019-06-27T02:15:07+07:00').format('MM/DD/YYYY') // 06/27/2562

Disabled Buddhist Era

moment.buddhistEra(false)
moment('2019-06-27T02:15:07+07:00').format('MM/DD/YYYY') // 06/27/2019

Disabled Buddhist Era in format method

moment('2019-06-27T02:15:07+07:00').format('MM/DD/YYYY', { be: false }) // 06/27/2019

License

MIT License

Copyright (c) 2021 Chettapong Pinsuwan

Package Sidebar

Install

npm i @chettapong/moment-buddhist-era.js

Weekly Downloads

1

Version

0.0.5

License

MIT

Unpacked Size

6.7 kB

Total Files

5

Last publish

Collaborators

  • chettapong