Giter Club home page Giter Club logo

moment's Introduction

moment

NPM version NPM quality Coverage Status Dependencies Build Status Known Vulnerabilities NPM download license issues

A minimalist JavaScript library that parses, validates, manipulates, and displays dates and times for modern browsers with a largely Moment.js-compatible API, written with TypeScript, inspired by Dayjs and Moment.js

moment().startOf('month').add(1, 'day').set('year', 2019).format('YYYY-MM-DD HH:mm:ss');
  • ๐Ÿ•’ Familiar Moment.js API & patterns
  • ๐Ÿ’ช Immutable
  • ๐Ÿ”ฅ Chainable
  • โ‡๏ธ TypeScript
  • ๐ŸŒ I18n support (WIP, will be soon)
  • ๐Ÿ”Œ Plugin System (WIP, will be soon)

Install

$ npm install @zcorky/moment

Usage

// typescript
import moment from '@zcorky/moment';

moment('2018-08-08') // parse

moment().format('{YYYY} MM-DDTHH:mm:ss SSS [Z] A') // display

moment().set('month', 3).month() // get & set

moment().add(1, 'year') // manipulate

Relatived

  • dayjs - immutable date time library alternative to Moment.js with the same modern API.
  • moment - Parse, validate, manipulate, and display dates in javascript.
  • luxon - โฑ A library for working with dates and times in JS.

License

MIT ยฉ Moeover

moment's People

Contributors

whatwewant avatar

Stargazers

 avatar Jennifer Wilmott avatar

Watchers

James Cloos avatar  avatar

moment's Issues

[timezone] support custome timezone

Situations

    1. transform to local timezone time
    • Have current user localtime => hope to get other timezones local time
    1. transform from specify timezone time
    • Have a localtime + specified timezone => get current user local time

[CI] Circle CI with Jest Memory Not Enough

  • question

      1. see the circle ci panel, found error Too long with no output (exceeded 10m0s), but no any more message. circle link
      1. so i Rerun job with SSH, then get into circle ci ssh server
      1. after get into ssh server, run npm run test, but found error
        about jest modules, so run yarn to install lack modules; then run
        npm run test again, found error ENOMEM: not enough memory, read
      1. search from google, found answer in disscuss Not enough memory while testing a Node.js appplication
      1. read all messages from the discuss, one man enapupe say he fix
        jest memory issues with running single thread -w 1. thanks.
  • solution:

    • jest memory issues, limit thread with jest -w 1

plugin design

design a plugin mode for plugin, according to dayjs.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.