As title says, UI Calendar component doesn't respect the Date object passed in for setDate(), setCurrentDate(), setSelectedDate().
Oddly, it overrides the passed in Date's hour, minute, second and millisecond in the MonthView member class's setCurrentDay() and setSelectedDay() methods.
It sets the hour/hour of day to 1 (huh? I could see 0 hour/midnight, but why 1am?), and sets minute, second and millis to 0.
This current behaviour is annoying & unexpected based on lack of documentation about the arbitrary resetting of the Date value and problematic in cases where a specific hour/minute/second/millis value is expected/needed.
Since what is being passed in by the user/developer is a java Date object, the hours, minutes, and seconds should be respected by the component.
If setting/getting hour/minute/second/millis "normalized" values is desirable, perhaps that should be a settable option via a new method in the Calendar class (i.e. normalizeTo(int hour, int minute, int second, int millis), but at the very least what the user/developer sets the Date object value to should be respected and set "as-is" by default.
As title says, UI Calendar component doesn't respect the Date object passed in for setDate(), setCurrentDate(), setSelectedDate().
Oddly, it overrides the passed in Date's hour, minute, second and millisecond in the MonthView member class's setCurrentDay() and setSelectedDay() methods.
It sets the hour/hour of day to 1 (huh? I could see 0 hour/midnight, but why 1am?), and sets minute, second and millis to 0.
This current behaviour is annoying & unexpected based on lack of documentation about the arbitrary resetting of the Date value and problematic in cases where a specific hour/minute/second/millis value is expected/needed.
Since what is being passed in by the user/developer is a java Date object, the hours, minutes, and seconds should be respected by the component.
If setting/getting hour/minute/second/millis "normalized" values is desirable, perhaps that should be a settable option via a new method in the Calendar class (i.e. normalizeTo(int hour, int minute, int second, int millis), but at the very least what the user/developer sets the Date object value to should be respected and set "as-is" by default.