1- include the following code in a .js file and include the file your view page:
PrimeFaces.locales ['fa'] = {
closeText:'بستن',
prevText:'>',
nextText:'<',
currentText:'اكنون',
monthNames:['فروردين', 'ارديبهشت', 'خرداد', 'تير', 'مرداد', 'شهريور', 'مهر', 'آبان', 'آذر', 'دي', 'بهمن', 'اسفند'],
monthNamesShort:['فروردين', 'ارديبهشت', 'خرداد', 'تير', 'مرداد', 'شهريور', 'مهر', 'آبان', 'آذر', 'دي', 'بهمن', 'اسفند'],
dayNames:['يکشنبه', 'دوشنبه', 'سهشنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه'],
dayNamesShort:['يك', 'دو', 'سه', 'چه', 'پن', 'جم', 'شن'],
dayNamesMin: ['ي', 'د', 'س', 'چ ', 'پ', 'ج ', 'ش'],
weekHeader:'هف',
firstDay:6,
isRTL:true,
showMonthAfterYear:false,
yearSuffix:''
,timeOnlyTitle: 'فقط زمان' ,
timeText: 'زمان',
hourText: 'ساعت',
minuteText: 'دقيقه',
secondText: 'ثانيه',
ampm: false,
month: 'ماه',
week: 'هفته',
day: 'روز',
allDayText: 'همه روزها'
};
2-use a JSF converter for your p:calendar component to handle date conversion:
--step 1--- put the following in your faces-config:
<converter>
<converter-id>com.blabla.SolarDateConverter</converter-id>
<converter-class>com.blabla.SolarDateConverter</converter-class>
</converter>
---step 2--- Create the converter class (com.blabla.SolarDateConverter) and implement "javax.faces.Converter" interface.
---step 3--- implement "getAsObject" method and do the date conversion in java code FROM date String submitted by the calendar component TO Date object and FROM jalali TO gregorian.
---step 4--- implement "getAsString" method and do the opposite actions of what you did in "getAsObject"
---step 5--- add the following line inside your p:calendar tag :
<f:converter converterId="com.blabla.SolarDateConverter"/>