I have a form with two date fields: one has a date and time, and the other is just a date. What is the best way to create a PropertyEditorSupport class so that I can handle both situations as they both are represented as java.util.Date?
I started by creating such a class and to override the setAsText method, which works perfectly. However, if I don't override getAsText, then I get the full timestamp. And this is where my dilemma begins ... if one is a date and time, and the other is just a date, how can I output them to be displayed differently?
I do have a kludge which does work, but now I'm testing logic inside a view instead of keeping it in my business class. On overriding getAsText, I check of the date has an hour greater than zero (which works because I'm only dealing with regular office hours).