Invalid date formatted to Today

  • 16 February 2023
  • 1 reply

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?

1 reply

I’m not using the CLI integration but the Platform UI with some code parts. However, we’re having the same issue, if I enter a completely invalid date… say a string for example : “Hello World”, then it gets converted to the current datetime. I would consider that a bug on Zapier’s end… Should throw an exception or set the value to null in my opinion.