Skip to content

Azbito/moontempo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 

Repository files navigation

moontempo Javascript

English

This library will help you to get the difference of time between dates.

How to use:

Installation

npm i moontempo

Difference between years

If you want to get the difference between years, you should run the function:

console.log(getYearsPassed("YYYY-MM-DD"))

console.log(getYearsPassed("2004-10-09")) // returns 18

Difference between months

If you want to get the difference between months, you should run the function:

console.log(getMonthsPassed("YYYY-MM-DD"))

console.log(getMonthsPassed("2022-10-09")) // returns 6

Difference between days

If you want to get the difference between days, you should run the function:

console.log(getDaysPassed("YYYY-MM-DD"))

console.log(getDaysPassed("2023-03-12")) // returns 30

Leap year

To get this information, you should run:

console.log(isLeapYear(2020)) // returns true

console.log(isLeapYear(2023)) // returns false

English

Esta biblioteca te ajudará a pegar a diferença entre datas.

Como usar:

Instalação

npm i moontempo

Diferença entre anos

Se você quiser pegar a diferença entre anos, você deverá rodar esta função:

console.log(getYearsPassed("AAAA-MM-DD"))

console.log(getYearsPassed("2004-10-09")) // retorna 18

Diferença entre meses

Se você quiser pegar a diferença entre meses, você deverá rodar esta função:

console.log(getMonthsPassed("AAAA-MM-DD"))

console.log(getMonthsPassed("2022-10-09")) // returna 6

Diferença entre dias

Se você quiser pegar a diferença entre dias, você deverá rodar esta função:

console.log(getDaysPassed("AAAA-MM-DD"))

console.log(getDaysPassed("2023-03-12")) // retorna 30

Ano bisexto

Para pegar esta informação, você deve rodar esta função:

console.log(isLeapYear(2020)) // retorna true

console.log(isLeapYear(2023)) // retorna false

English

Ceci est une bibliothèque qui vous aidera à faire la différence entre deux dates.

Comment utiliser:

Installation

npm i moontempo

Faire la différence entre années

Si vous souhaitez faire la différence entre années, vous devez exécuter cette fonction:

console.log(getYearsPassed("AAAA-MM-JJ"))

console.log(getYearsPassed("2004-10-09")) // retourne 18

Faire la différence entre mois

Si vous souhaitez faire la différence entre mois, vous devez exécuter cette fonction:

console.log(getMonthsPassed("AAAA-MM-JJ"))

console.log(getMonthsPassed("2022-10-09")) // retourne 6

Faire la différence entre jours

Si vous souhaitez faire la différence entre jours, vous devez exécuter cette fonction:

console.log(getDaysPassed("AAAA-MM-JJ"))

console.log(getDaysPassed("2023-03-12")) // retourne 30

Année bissextile

Pour savoir de ces information, vous devez exécuter cette fonction:

console.log(isLeapYear(2020)) // retourne true

console.log(isLeapYear(2023)) // retourne false

About

This library helps you to get the difference between times.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published