using resource bundle to set rich:calendar datePattern
hordine Oct 14, 2008 1:43 PMHi everyone,
I`m trying to set my rich:calendar`s datePattern by using a resource bundle so i can internationalize my app, and I get the error:
'10/31/2008' could not be understood as a date.
When I set the pattern as a literal string, like "MM/dd/yyyy", it works fine.
Here is my jsp:
<rich:calendar id="startDateInput"
value="#{budgetBean.budget.startDate}"
required="true"
requiredMessage="#{bundle.budget-startDate-required}"
datePattern="MM/dd/yyyy">
</rich:calendar>
<rich:calendar id="endDateInput"
value="#{budgetBean.budget.endDate}" required="false" datePattern="#{bundle.dateFormat}">
</rich:calendar>
I thought it could be a problem with my properties file, so I checked the HTML code that was being generated and they seem to be exactly the same:
Calendar('editBudgetForm:startDateInput', {dayListTableId: 'editBudgetForm:startDateInputDay',
weekNumberBarId: 'editBudgetForm:startDateInputWeekNum',
weekDayBarId: 'editBudgetForm:startDateInputWeekDay',
currentDate: new Date(2008,9,1),
selectedDate: new Date(2008,9,1,0,0,0),
datePattern: 'MM/dd/yyyy',
jointPoint: 'bottom-left',
direction: 'bottom-right',
toolTipMode:'batch',
boundaryDatesMode:'inactive',
popup: true,
enableManualInput: false,
showInput: true,
disabled: false,
ajaxSingle: true,
verticalOffset:0,
horizontalOffset: 0,
style:'z-index: 3; ',
firstWeekDay: 0,
minDaysInFirstWeek: 1,
todayControlMode:'select',
showHeader:true,
showFooter:true,
showWeeksBar:true,
showWeekDaysBar:true,
showApplyButton:false,
resetTimeOnDateSelect:false,
defaultTime:{hours:12,minutes:0},
and
id="editBudgetForm:endDateInputScript" style="display: none;">new Calendar('editBudgetForm:endDateInput', {dayListTableId: 'editBudgetForm:endDateInputDay',
weekNumberBarId: 'editBudgetForm:endDateInputWeekNum',
weekDayBarId: 'editBudgetForm:endDateInputWeekDay',
currentDate: new Date(2008,9,1),
selectedDate: new Date(2008,9,31,23,59,0),
datePattern: 'MM/dd/yyyy',
jointPoint: 'bottom-left',
direction: 'bottom-right',
toolTipMode:'batch',
boundaryDatesMode:'inactive',
popup: true,
enableManualInput: false,
showInput: true,
disabled: false,
ajaxSingle: true,
verticalOffset:0,
horizontalOffset: 0,
style:'z-index: 3; ',
firstWeekDay: 0,
minDaysInFirstWeek: 1,
todayControlMode:'select',
showHeader:true,
showFooter:true,
showWeeksBar:true,
showWeekDaysBar:true,
showApplyButton:false,
resetTimeOnDateSelect:false,
defaultTime:{hours:12,minutes:0},
Does anyone know why this happens? Or could give me another idea of how to internationalize rich:calendar?