Supply current unix timestamp with parseTime

This commit is contained in:
SileNce5k 2025-05-16 18:53:41 +02:00
parent ec5993e585
commit 22d1cbd570
Signed by: SileNce
GPG key ID: B0A142BB4291B204

View file

@ -8,7 +8,7 @@ module.exports = async function (message, args) {
let currentUnixTime = Math.floor(new Date() / 1000); let currentUnixTime = Math.floor(new Date() / 1000);
let timeInSeconds; let timeInSeconds;
if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0]))){ if(!isNaN(Date.parse(args[0])) && isNaN(parseTime(args[0], currentUnixTime))){
timeInSeconds = timeUntil(args[0]).totalInSeconds; timeInSeconds = timeUntil(args[0]).totalInSeconds;
if(timeInSeconds < 0){ if(timeInSeconds < 0){
return "The date must not be in the past." return "The date must not be in the past."