The date picker item type has had a makeover in APEX 4.0. Instead of opening a calendar in a separate browser window with a basic calendar, APEX now shows an ajax style calendar. Also with a lot more options to configure the calendar.
In previous APEX versions the date picker looks like this:

This is how the date picker looks in APEX 4.0:

A much better looking calendar then the popup window in previous versions and also a lot faster for the user. But it is not just about the look and feel, but the new date picker also gives a number of settings to control the calendar.

With the setting Highlighted Date you specify the date to be highlighted when showing the calendar. The settings Minimum Date and Maximum Date define the minimum and maximum date selectable in the calendar. This way you can restrict what date a user can select, a very nice addition. These three date picker properties can all be defined in three ways:
- Absolute, for instance 16-APR-2010
- Relative to today’s date, for instance +1y+1m+1w sets the allowed date to 1 year, 1 month and 1 week after today.
- Item value, the date is determined from the value of a page item, for instance &P1_DATE.
As you can see a lot of options to control the input values of your date picker item. The example below shows setting the minimum and maximum date to a week relative to today’s date. You cannot select another date the the range specified.

The show setting defines when the calendar has to be shown. There are four possible settings:
- on focus: shows the calendar when the item receives focus
- on icon click: shows the calendar when the date icon is clicked
- both: shows the calendar when either of the above events take place
- inline: shows the calendar directly on the page , without an input item
The last date picker setting I will discuss is the Number of Months setting. This setting controls the number of months displayed at once. This can be a single number, for instance 2, this will display two months next to each other. But it can also be an array of two numbers (between brackets), for instance [2,2], this will display four months at the same time in two rows and two columns.

All in all a very big improvement over the date picker in previous APEX versions.


Whitehorses is specialized in succesfully implementing Oracle SOA solutions: BPEL, OSB, WebLogic & BPM
{ 5 comments… read them below or add one }
Yes, this is the datepicker we all have been waiting for in Apex. The interaction is well-thought, really nice. Thanks for sharing, Peter.
Is it also possible to include the time in this date picker? In the previous version of ApEx you could include a time, but who wants to select minutes 1 thru 59. I would settle for 15, 30, 45 minutes and the whole hour. Is it possible to set this anywhere? It would be a great help.
Thanks…
Hi Victor,
When you include the time you will still get a drop down list with all the minutes 00 through 59. There seems to be no setting to control the time fields in the date picker.
Maybe you can submit a feature request for his.
hi Dear
In Apex 4.0 How can used the Persian calendar
Because the gregorian year is different with the Persian
For example, in 2010 gregorian=1389 Persian
my nls_calendar=persian
When the “nls_calendar =persian” then all date values are show to gregorian.
Thanks a lot
Jovaini
hi, do u know how to make to the mimimum date be today and works? thanks!