dateformat-mm

0.0.7 • Public • Published
 

Dateformat

Github top language Github language count Repository size License Github issues Github stars

🚧 Dateformat 🚀 Under construction... 🚧


🎯 About

dateformat is a simple library that formats dates to something more understandable using the object Intl.RelativeTimeFormat. the module requires two parameters, the date and a language, by default the language is set to 'en', the language format supported is .ISO 639-1 code.

🏁 How to use

// import the module using
const { dateformat } = require('dateformat-mm');
// or
import { dateformat } from 'dateformat-mm';


// use
const dateFormat = dateformat('2020-11-12', 'en');
console.log(dateFormat)
>> 195 days ago
// returns from the current date, the days that have passed in the English language

// or you can also use
const dateFormatEs = dateformat('2021-05-26T01:00:36.876Z', 'es');
console.log(dateFormatEs)
>> hace 16 horas

📝 License

This project is under license from MIT. For more details, see the LICENSE file.

Made with ❤️ by ManuelMaciel

 

Back to top

Package Sidebar

Install

npm i dateformat-mm

Weekly Downloads

2

Version

0.0.7

License

MIT

Unpacked Size

6.45 kB

Total Files

6

Last publish

Collaborators

  • manuelmaciel