How to validate full iso date time string with Luxon

62 views Asked by At

So what I want is to get a validation error for this iso string:

const dateTime = luxon.DateTime.fromISO("3");
console.log(dateTime.isValid); //true

I can't understand why this is a valid ISO date? Can I accept only this format to be valid:

const dateTime = luxon.DateTime.fromISO("2024-03-04T19:44:41.206Z");
console.log(dateTime.isValid); //true

Thank you!

0

There are 0 answers