Thursday, May 28, 2009

How to add leading zeros after selecting value from a calendar dashboard prompt

I received an email about the problem in date format when choosing value from calendar dashboard prompt, it’s shows 2009-5-1 for example without leading zero. It should show 2009-05-01. This question/issue has also been posted on OTN Discusion Forum http://forums.oracle.com/forums/thread.jspa?threadID=904990&tstart=0.

First, set the correct format in localedefinitions.xml:



Now, open calendar.js from location \OracleBI\oc4j_bi\j2ee\home\applications\analytics\analytics\res\b_mozilla, not from location \OracleBI\web\app\res\b_mozilla.

Add a part of the code for adding leading zeros for days and months only. We add this inside the NQCSetDate function.



Now you are able to see leading zeros in days and months, everytime. The length is always 2.

No comments: