0.0.1 • Published 1 year ago

moment-extras v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Introduction

Moment-extras is a extender for the moment package which simplifies using moment as well as add a bit of utility features that may not be seen in the near future.

This package was made for a hackthon by Documatic Documatic is a search engine for your codebase; Ask documatic a question and find relevant code snippets and insights in seconds.

https://www.documatic.com/ Documatic acts as a search engine for your codebase; once you describe what you're looking for, Documatic pulls up related code or documentation making it easier to find what you're looking for in seconds!

Not sitting next to each other? No problem. Ask Documatic questions of your codebase to learn and understand your code in seconds. Documatic is the team member you wish you had

Our Visual studio Code extension: https://marketplace.visualstudio.com/items?itemName=Documatic.documatic https://cdn.discordapp.com/attachments/926110059782615071/1037404343470661713/Documatic_sh6hrz.gif

Installation

# With npm
npm install https://github.com/LegItMate/documetic-heckathon.git
# With yarn
yarn add https://github.com/LegItMate/documetic-heckathon.git

Usage

// Import moment-extras and configure the module
require('moment-extras')({ throwOnInvalidDate: true });

// Import moment
const moment = require('moment');

/*
    moment.parse(inp, format, fn);
    inp: Your Date String
    format: The format to read the time
    fn: Allows using different functions that can parse time
        `utc`, `tz`, `parseZone`, `parseTwoDigitYear`
*/
moment.parse('1996-09-01', 'YYYY-MM-DD', 'utc');

Contribution

If you wish to add any new features or implement any other simplification for using moment, feel free to fork the repository and create a Pull Request with your suitable changes! Any feature requests and bug reports are also welcomed.