Hello All,
I have a requirement.
Do we have any built in service that can be used to identify if the input date is invalid or not.
Example: 2929-07-28 should be returned as invalid.
Urgent help needed!
Regards,
Khushaboo Shandilya
Hello All,
I have a requirement.
Do we have any built in service that can be used to identify if the input date is invalid or not.
Example: 2929-07-28 should be returned as invalid.
Urgent help needed!
Regards,
Khushaboo Shandilya
Hi Khushaboo,
We can check for the date formats using built in service dateTimeFormat and that will fail if there is invalid date.
But there is no straight built in service to confirm if the date is valid or not as far as I know.
Regards,
Firoz N
Hi Khushaboo,
your example is a valid date (even when 909 years in the future) as per the accordning ISO documentation for dates.
If you want to exclude dates that far in the future, you will have to validate it by your self.
There is an interesting discussion about calculating date differences in this topic:
Regards,
Holger
Hi,
Just wondering: Are you trying to develop/implementing this logic in wm.io/cloud tenant or on-prem IS instance setup thru?
Anyways there is none OOTB service available to check and scan if it’s a future date (reject) vs current date (valid case) and so may need to go with custom java code validation techniques etc…
HTH,
RMG
For those interested, attached is a quick sample of a service I just put together in webMethods.io Integration FlowService without any java coding required using the public date services. It could be improved, but gives you an idea.
This checks for a historical date, to make sure someone isn’t older than 150
but the check could be flipped in the opposite direction.
I couldn’t attach the zip export here as it’s not an allowed extension, so to use:
dateString
, and an output variable called valid
dateValidation.txt (11.5 KB)
Thanks a lot and time Dave on putting this info to SAG community
Cheers from the tech community!
RMG
Hi,
Can you explain your use-case and reason why the above date should be invalid?