Fix bug calculateAge birthday message

This commit is contained in:
Divlo 2019-09-19 09:43:36 +02:00
parent 1a5c424d8f
commit c91feaa895

View File

@ -76,7 +76,7 @@ function calculateAge(birthDateEntered) {
if(isValidDateFunction === true)
{
// Si c'est ton anniversaire aujourd'hui
if(birthDateDay === parseInt(day) && birthDateMonth === parseInt(month))
if(birthDateDay === parseInt(day) && (parseInt(birthDateMonth) + 1) === parseInt(month))
{
return 'Vous avez ' + ageYears + ' ans. Joyeux Anniversaire! 🥳';
}