Closed kryops closed 9 months ago
Describe the bug When setting Settings.throwOnInvalid, Luxon does not seem to throw an error if the year is too large (both positive or negative), even though dateTime.isValid will return false.
Settings.throwOnInvalid
dateTime.isValid
false
To Reproduce
luxon.Settings.throwOnInvalid = true; const dateTime = luxon.DateTime.fromObject({ year: 1000000 }); console.log(dateTime.isValid, dateTime.invalidReason);
Actual vs Expected behavior
Expected: An error is thrown
Actual: false invalid input is logged to the console
false invalid input
Desktop:
Thanks for looking into it!
Describe the bug When setting
Settings.throwOnInvalid
, Luxon does not seem to throw an error if the year is too large (both positive or negative), even thoughdateTime.isValid
will returnfalse
.To Reproduce
Actual vs Expected behavior
Expected: An error is thrown
Actual:
false invalid input
is logged to the consoleDesktop:
Thanks for looking into it!