Follow Us on Twitter

[Oracle APEX 4.0] New date picker

by Peter van der Neut on April 16, 2010 · 6 comments

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.

[Oracle APEX 4.0] New date picker, 4.1 out of 5 based on 8 ratings

Ratings:
VN:F [1.9.22_1171]
Rating: 4.1/5 (8 votes cast)
Tags: ,

{ 6 comments… read them below or add one }

Patrick sinke April 16, 2010 at 9:23 pm

Yes, this is the datepicker we all have been waiting for in Apex. The interaction is well-thought, really nice. Thanks for sharing, Peter.

Reply

Victor Bax August 1, 2010 at 8:58 pm

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…

Reply

Peter van der Neut August 16, 2010 at 8:35 am

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.

Reply

jovaini October 18, 2010 at 1:55 pm

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

Reply

abraxas April 25, 2011 at 5:31 pm

hi, do u know how to make to the mimimum date be today and works? thanks!

Reply

Moumni March 25, 2013 at 5:39 pm

@abraxas, +0d in minimum field..
What i don’t understand about that part is that when you want to update a record that allready has a date filled, how to make it save my record without apex nagging about the date… because at the time of saving that record the date was in the future so its fine that the record holds his old date.

Greets,

Moumni
webdew

Reply

Leave a Comment

 

Previous post:

Next post:

About Whitehorses
Company profile
Services
Technology

Whitehorses website

Home page
Whitebooks
Jobs

Follow us
Blog post RSS
Comment RSS
Twitter