Just a quick note. I picked up an undocumented feature in the code.
If you look at MyDateTimeEditorElement line 97. There is a problem in that if your current date for instance is 31 January and you select February from the Month Grid, the date is not properly updated as 31 Jan is after the last day that is available in Feb.
Correction
Get the last day of the current month, if it is after the selected date, use the new lastDayOfMonth.
All Better.
Thx
Theo Jacobs