Code Monkey home page Code Monkey logo

date-lib's Introduction

Date-Lib

Library for simplify working with dates: convert to different formats, count days from any time to today.

Usage

Import library:

const date = require('date-lib');

Current date in users format:

date.format('MM.DD.YYYY, h:mm:ss'); // return current date '5.6.2020, 02:37:40'

Count days from some day to today:

date.fromNow('2016-6-2'); // 1581

Convert date from one format to another:

const day = '12-04-2020'
const Converter = date.Converter;
const converter = new Converter(day);
converter.from('DD-MM-YYYY').to('MM/DD/YYYY'); // return '04/12/2020'

Compare any date with current date (can return true or false):

isBefore('2001/08/19'); // return true
isAfter('2025:4:3'); // return true

Contributing

To contribute in my project you should fork it to your account, make changes and send a pull request where you need to describe what changes you make and why it’s important. Feel free to contact me and discuss your contributing.

date-lib's People

Contributors

dependabot[bot] avatar lightballer avatar

Watchers

 avatar

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.