fix issue with month returning 1 less than expected

This commit is contained in:
SileNce5k 2021-02-19 22:12:10 +01:00
parent 6a82245021
commit 0b6e92a75f
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -2,9 +2,9 @@ module.exports = function (user) {
let creationMonth, creationDate, creationHours, creationMinutes, creationSeconds;
if (user.createdAt.getUTCMonth().toString().length === 1)
creationMonth = "0" + user.createdAt.getUTCMonth()
creationMonth = "0" + (1+user.createdAt.getUTCMonth())
else
creationMonth = user.createdAt.getUTCMonth()
creationMonth = (1+user.createdAt.getUTCMonth())
if (user.createdAt.getUTCDate().toString().length === 1)
creationDate = "0" + user.createdAt.getUTCDate()