Customizing Date Format

For the customization of the date layout, the Common.xml locale file is used. This file contains the following entries:

<entry>
    <keyword>DATE_FORMAT.LONG.VALUE</keyword>
    <phrase>MMMM dd, yyyy</phrase>
</entry>
<entry>
    <keyword>DATE_FORMAT.MEDIUM.VALUE</keyword>
    <phrase>MMM-dd-yyyy</phrase>
</entry>
<entry>
    <keyword>DATE_FORMAT.SHORT.VALUE</keyword>
    <phrase>MM/dd/yyyy</phrase>
</entry>

To customize the date format, you need to change the <phrase> values using the following elements:

Element Description Example

yyyy

full year value

"2021"

yy

short year value

"21"

MMMM

full month value

"February"

MMM

medium month value

"Feb"

MM

short month value

"02"

dd

day value

"28"

That is, the short date format for the Japanese date layout ("2021-02-28") looks as follows: yyyy-MM-dd.

The following instructions show two alternative ways to enable a customized date layout. Here, the example of the Japanese date layout is used, however, the instructions may be applied to any locale.

I

In this method, the date layout is customized with the help of L10N, a web tool that is used to create localization files.

  1. In the L10N localization web tool, set the required date format, and upload the changed parameters into the Common.xml file.
  2. Go to System > Settings > Locales in the Core group.
  3. Select the Japanese locale (click the ja Language Code, or on the Japan language).
  4. Open the Customized Locale Files tab.
  5. Click Add.
  6. Select the updated Common.xml file, using Browse.
  7. Click Submit.

II

In this method, the date layout is customized by editing the existing Common.xml file.

  1. Go to System > Settings > Locales in the Core group.
  2. Select the default locale (en_US).
  3. Open the Source Locale Files tab.
  4. Click the Download link opposite the Common.xml file.
  5. In the Common.xml file, configure the date format in the related file sections.
  6. Go to System > Settings > Locales in the Core group.
  7. Select the Japanese locale (click the ja Language Code, or on the Japan language).
  8. Open the Customized Locale Files tab.
  9. Click Add.
  10. Select the updated Common.xml file, using Browse.
  11. Click Submit.

After completing the above actions, log out from CloudBlue Commerce, and log in to CloudBlue Commerce (under any valid account) selecting the Japan language on the log-in screen. Go to any screen that contains date fields. You will see that all dates are displayed in the Japanese date format.

CloudBlue, an Ingram Micro business, uses cookies to improve the usability of our site. By continuing to use this site and/or logging in you are accepting the use of these cookies. For more information, visit our Privacy Policy.