Databases Reference
In-Depth Information
Figure 3-2. Dynamic min/max date when booking tickets
Solution Requirements
To get around the static min/max date issue, you're going to create a dynamic from/to date picker. The
new date picker will have the following functionality:
•
Restrict the
to
date when a
from
date is selected; for example, suppose you
selected 20-Jan-2010 as your
from
date. When a user selects a date from the
to
date
picker, he or she can't select anything before 20-Jan-2010 (i.e., the user can't select
any dates from before 19-Jan-2010).
•
Restrict the
from
date when a
to
date is selected; see the previous example in
reverse.
•
Allow developers to select when the calendar is displayed
•
Support multiple date formats; date formats do not need to be the same for both
the
from
and
to
dates.
•
Back-end validation that dates are valid dates (if “execute validations” is set to yes)
•
Back-end validation that
from
date is less than or equal to the
to
date
Building the Item Plug-In
Now that the business requirements have been defined, it's time to start building the new date picker
plug-in. This plug-in will cover some of the most common features that you may encounter when