Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

FormatDateTime ignores the name of Japanese Era

SA-64372

Summary



Java Calendar class supports the local calendar such as Japanese Imperial Calendar or Thai Buddhist Calendar.

Using the Rule Utility Function (RUF) FormatDateTime, specify ja_JP_JP locale instead of standard ja_JP. This displays the Japanese Calendar year number correctly (for example, 30 for AD2018). However, it ignores the name of Era (such as 平成 (Heisei)) text string.




Note: Japanese Era must display  as 'JapaneseEra Custom'.


Error Messages



Not  Applicable


Steps to Reproduce



Create a declare expression or a data transform to set the text string using FormatDateTime RUF: @FormatDateTime(".CommonEra","GGGGy年M月d日","Asia/Tokyo","ja_JP_JP"). 

The date is not formatted and is displayed as 30年8月3日. The date must display as 平成30年8月3日.



Root Cause



This issue was determined to be a product enhancement request.


Resolution



An enhancement request, FDBK-28141, is created for consideration by Pega Product Management.

Perform the following local-change:

1. Create a custom function (JapanDate) to update the Japanese Era.

Locale locale = new Locale(strLocale);
DateFormat jp = new SimpleDateFormat(strPattern,locale);
Date date=new Date();

try{
  DateFormat pega=new SimpleDateFormat("yyyyMMdd",new Locale("en","US"));                                      date=pega.parse(strDateTime);
} catch (java.text.ParseException e) {


return jp.format(date); 2.  Use JapanDate  function instead of FormatDateTime as below.

@JapanDate(".CommonEra","GGGGy年M月d日","Asia/Tokyo","ja_JP_JP")


 

Published September 11, 2018 - Updated December 2, 2021

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us