问题
How do you control the display of the time and dates on the iNotes Calendar control in an XPage? I would like to have the times shown using the 12 hour format hh:mm AM and the date to use MMM dd, yyyy.
Thank you.
回答1:
The date and time format for iNotes Calendar is defined in language files for the most common languages. These language files are specific for iNotes Calendar.
They are stored in com.ibm.xsp.extlib.domino_x.x.x.xxxxxxxx-xxxx.jar
file in folder DominoServerPath\data\domino\workspace\applications\eclipse\plugins
.
If you unpack the jar file (it's just a zip file) you'll find a folder resources\web\dwa\date\nls
and there the language specific subfolders like de
, en
, en-gb
, en-ie
and en-us
. The date and time format is definied in that subfolders in file calendar.js
.
This file starts e.g. for en-us
with the lines:
Surprisingly, the date and time format is not right for the US en-us
. Same for en
, en-gb
and en-ie
. I'd call it a bug or at least a wrong packaging.
If you change the time format line to D_DTFMT_TIME0: "hh:mmt"
then you get your 12 hour time format with am/pm.
Close to setting D_DTFMT_TIME0
are all the other settings for date and time formatting.
So, change all en
languages files with the appropriate values, save them back to the jar file and restart the Domino server.
Just for further research: the date and time values get formatted with the help of ...jar\resources\web\dwa\date\dateFormatter.js
.
来源:https://stackoverflow.com/questions/18411426/xpages-inotes-calendar