Current Date is not selected in Calendar

34 views
Skip to first unread message

MS

unread,
Dec 11, 2023, 4:38:51 PM12/11/23
to Orbeon Forms
 Hello,

I created a test form to test "fr:date". 

Problem Statement:  There is not any preselected date or Current Date highlighted in the calendar. 

Expected Result: 
-Today's date should be pre-selected in calendar, if there is a null value in database for that field. [Not Working]
- If there is a date coming from Database, that date should be selected in the calendar.  [Working] 

Thank You,
MS
testDate.jsp
Date.png

MS

unread,
Dec 12, 2023, 4:56:08 PM12/12/23
to Orbeon Forms
I am using Orbeon 2022.1.3 version. 

Alessandro Vernet

unread,
Dec 13, 2023, 9:03:46 PM12/13/23
to orb...@googlegroups.com
Hi MS,

If a date is selected, that date is highlighted when the picker opens.
If no date is selected, no date is highlighted when the picker is opened.

Highlighting the current date in the second case would make you think that the current date was selected, which it wasn't. However, if you want the current date to be selected automatically if no other date is selected, you can use a calculated value like this:

    if (xxf:is-blank()) then current-date() else .

Let me know if this makes sense.

-Alex
Reply all
Reply to author
Forward
0 new messages