moment-is-zero

1.0.5 • Public • Published

Build Status

A plugin to recognize 0001-01-01T00:00:00Z or unix timestamp 0 for moment.js.

Recognizing 0001-01-01T00:00:00Z may convenient for some backend language like golang.

Install

npm install moment-is-zero --save

or

yarn add moment-is-zero

Usage

moment('0001-01-01T00:00:00Z').isZero()

or

moment.unix(0).isZero()

return value true or false.

notice:

moment('0001-01-01T00:00:00Z+08:00').isZero() is false. You need remove time zone yourself.

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i moment-is-zero

Weekly Downloads

1

Version

1.0.5

License

MIT

Last publish

Collaborators

  • 297951292