My CLI application/integration has several actions each with one or more datetime input fields. My QA team has reported that when they send an invalid date string, e.g. `2023-02-31`, it is converted to today’s date and time.
I have put some console logging into the action perform function and confirmed that when the rawInput value is an invalid date, the input value is today’s date.
I have been asked to treat invalid dates as an error and to halt execution.
I have considered adding code that checks the input value and if it is today’s date, then inspects the rawInput to determine if the original input was an invalid date. I think this sounds much easier said than done.
Is there an easier way to do this? Is there some way to get the formatter to not convert invalid dates to today?