Press "Enter" to skip to content

Oracle Apex: Working with Date Picker

In this tutorial, I will show you some useful property settings of Oracle Apex Date Picker item.

I am going to use the properties shown in the below image so that when I will give the reference below of any property you can see it in the image.

Oracle Apex: Date Picker settings.

1. Highlighting another Date with Current Date

In Oracle Apex date picker the current date is highlighted and focused by default, but if there is a requirement to highlight and set focus to a particular date, then use the following settings for the Highlighted Date property:

For example, highlight the date after the 7th day of the current date.

  • Highlighted Date: +7d

Output

Oracle Apex: highlight a date.

Today is the 4th April 2020, so after adding the 7 more days the date 11th April is also highlighted.

Similarly, if you want to highlight a day before the current date use hyphen (-), for example:

-7d to highlight a date 7 day before the current date.

The basic syntax of specifying the date values are:

(+/-)(n)(d/w/m/y)

Examples:

-1w or +1w to highlight the date before or after 1 week of the current date.

+2m to highlight and focus a date after two months of the current date.

Also, you can specify a page item having a valid date value to highlight the particular date. For example, &P18_HDATE.

2. Setting a Minimum and Maximum Date

The same rules apply to the Minimum and Maximum Date settings. The following are the examples:

Setting a minimum date to the current date and maximum date to 2 weeks later the current date.

  • Minimum Date: +0d
  • Maximum Date: +2w

Output

Oracle Apex: Setting a minimum and maximum date.

You can notice in the above image, that all other dates are disabled and only the current date with dates 2 weeks later is enabled.

For these Minimum and Maximum property settings, you can also specify the page item having the valid date value.

3. Display Drop Down for the Month and Year

To display the drop-down list for Month and Year to access it easily, set the following property:

  • Navigation List for: Month or (Month and Year)

4. Display the Hours and Minutes Drop Down

To display the hours and minutes drop-down in the date picker item use for Format Mask property to specify the time format:

  • Format Mask: MM/DD/YYYY HH24:MI:SS

Output

Oracle Apex: show time in date picker.

Have you found the answer to your question? If not, you can discuss it with me in the comments section below or join my Q&A community OrclQA.com for developers and ask your question. It is FREE.

Vinish Kapoor

Follow

Hi, I am a full stack developer and writing about development. I document everything I learn and help thousands of people. foxinfotech.in is created, written, and maintained by me; it is built on WordPress, and hosted by Bluehost. Connect with me on Facebook, Twitter, GitHub, and get notifications for new posts.

guest
6 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
furqan
furqan
5 months ago

I have datetime picker and format is set to DD-MON-YYYY HH:MIPM.Issue is it is showing 12AM or 12PM as 00 in the drop down of hours.Can I customize the drop down or any other solution ?

Ahmad
Ahmad
Reply to  Vinish Kapoor
1 month ago

Is it possible to have today button only without having Hours, Minutes AP/PM displayed. I Used HH:MM:SS and it displays Hours, Minutes and Seconds.

Clark Pearson
Clark Pearson
3 months ago

Hi Vinish,

I want the highlighted date to be ‘today’.

I want to display 3 months, not just 1. (I know how to do this.)

But I want the 2 months prior to this month, not the 2 months after.

Is this possible?

Thank you,
Clark

Clark Pearson
Clark Pearson
Reply to  Clark Pearson
2 months ago

Hi Vinish – do you know if it’s possible to show earlier months with the date picker? (See earlier post.) Thanks.

Krish
Krish
1 month ago

Hi Vinish,
How to highlight the selected date in calendar region as like todays date.

Thanks,
Krish