On Date Conversion
Posted: February 28th, 2022, 12:03 pm
I have a method that I am building that takes in a date from a user as MM/DD/YYYY and then uses that date to query a JDE Table. In order to facilitate this I'm using the ToDate Data Conversion Service in order to change the date from a DisplayDate Format to a JDEDate Format.
The method above takes in the user's input, converts the dates to the necessary format, and then passes the information into the submethod where the query is run.
While using this method, I discovered that if the user refrains from putting in a date(meaning that the toDate service is given an empty string) the
toDate service defaults to returning the value for the current day. Using this output would break my method as I the user would be looking for results without specified date information rather than information filtered to today's date. I've created a workaround wherein I check if the original date was empty or not before passing in the information from the ToDate service. What I want to ask today is: Is the default return of the current day intentional? If so, is there another way of converting the date such that no default value would be given if no date was input?
The method above takes in the user's input, converts the dates to the necessary format, and then passes the information into the submethod where the query is run.
While using this method, I discovered that if the user refrains from putting in a date(meaning that the toDate service is given an empty string) the
toDate service defaults to returning the value for the current day. Using this output would break my method as I the user would be looking for results without specified date information rather than information filtered to today's date. I've created a workaround wherein I check if the original date was empty or not before passing in the information from the ToDate service. What I want to ask today is: Is the default return of the current day intentional? If so, is there another way of converting the date such that no default value would be given if no date was input?