Skip to content

dateformat is a simple library that formats dates to something more understandable using the object Intl.RelativeTimeFormat.

License

Notifications You must be signed in to change notification settings

ManuelMaciel/dateformat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

 

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

About

dateformat is a simple library that formats dates to something more understandable using the object Intl.RelativeTimeFormat.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published