Thursday, March 31, 2011

Enhancement of jquery datetime plugin

The problem
Lately integrate jquery datetime v1.0.5 plugin (http://plugins.jquery.com/project/datetime) into my web app to let user choose both date and time. When using it, found a problem if below conditions is applied.
  1. Min date and Max date is set.
  2. Default date and time is the middle of min and max date and the default date is following month of min date.
  3. e.g. Min date is 28/04/2011, Max date is 30/06/2011 and default date is 30/04/2011 16:00.

The problem are
  1. The calender shown May calender as expected but the previous button is disable and user cannot back to April which the Min date is set.
  2. User can forward to additional two months after the Max date month, which mean this case the next button only disable when user access until month of August. However, user still cannot choose the date after the Max date.