greatefue-datewizard

A Package which transform date to a friendly sentence etc.

Usage no npm install needed!

<script type="module">
  import greatefueDatewizard from 'https://cdn.skypack.dev/greatefue-datewizard';
</script>

README

Great Efue Date Wizard

A Package which transform date to a friendly sentence etc.

NPM Version NPM Downloads CI

Table of Contents

  1. Installation
  2. Usage
  3. Optional Parameter Table
  4. Releases
  5. Author
  6. License
  7. Team

Installation

$ yarn add greatefue-datewizard
$ npm i greatefue-datewizard

Usage

In your .ts or .js file,

  1. import the package
import { DaysAgo } from 'greatefue-datewizard';
  1. Call the function
var i = DaysAgo("2021-01-01");
console.log(i) //2 months ago
  1. Passing Optional Parameters
var i = DaysAgo("2021-01-01",{date:true});
console.log(i) //2 months ago
  1. Passing a future date returns difference from the current date to the future date.
var i = DaysAgo("2099-12-31");
console.log(i) //78 years into the future

Optional Parameter Table

Parameter Datatype Description Example Example Output
date boolean Extract year month day from date or datetime DaysAgo("2021-01-01T00:00:00",{date:true}); //2 months ago
time boolean Extract hour minute second from date or datetime DaysAgo("2021-01-01T00:00:00",{time:true}); //2 hours ago
year boolean Extract year from date or datetime DaysAgo("2021-01-01T00:00:00",{year:true}); //2 years ago
month boolean Extract month from date or datetime DaysAgo("2021-01-01T00:00:00",{month:true}); //2 months ago
day boolean Extract day from date or datetime DaysAgo("2021-01-01T00:00:00",{day:true}); //2 days ago
hour boolean Extract hour from datetime DaysAgo("2021-01-01T00:00:00",{hour:true}); //2 hours ago
minute boolean Extract minute from datetime DaysAgo("2021-01-01T00:00:00",{minute:true}); //2 minutes ago
second boolean Extract second from datetime DaysAgo("2021-01-01T00:00:30",{second:true}); //2 second ago

Author

Great Efue

Please consider supporting me on Patreon. Become a Patron of Great Efue!

License

FOSSA Status

Team

These are folks that keep the project moving and are resources for help.

Technical Steering Committee (TSC)

The people who manage releases, review feature requests, and meet regularly to ensure GreatEfue-DateWizard is properly maintained.


Great Efue

Temitope Afolabi

Reviewers

The people who review and implement new features.


Great Efue

Committers

The people who review and fix bugs and help triage issues.


Great Efue