Support > Wagby Developer Network(R7) > setting file > Handling of Japanese calendar
ja | en

In Wagby's Japanese calendar processing, four era information of "Meiji" "Taisho" "Showa" "Heisei" are set as standard. In addition to this, the developer can add a new year. In addition, we have prepared a setting to display the year as "the first year".

Output Control> Format

  1. Open the TranslateJpEra.properties.UTF8 file in the wagbydesigner/bin/webpage/WEB-INF/src folder with a text editor.
  2. Copy the previous era by adding a number.In the case of Heisei, as described in erainfo.3, when increasing the era name, copy this line to erainfo.4.
    erainfo.3.startdate=1989-1-8
    erainfo.3.enddate=9999-12-31
    erainfo.3.fullname=平成
    erainfo.3.shortname=平
    erainfo.3.shortchar1=H
    erainfo.3.shortchar2=H
    erainfo.3.shortchar3=H
    erainfo.3.shortchar4=h
    
    以前の元号の enddate を、その元号が終了した日にします。
    The startdate of the new era also has the same value, and enddate is 9999-12-31.
    Enter a value corresponding to the new erotic name fullname, shortname, shortcharXX.
  3. Run wagbydesigner/bin/webpage/WEB - INF/src/TranslateJpEra.bat file. (For non-Windows operating systems, use the extension ".sh".)
  4. The TranslateJpEra.properties file is recreated in this folder.(The extension .UTF8Not includedIt is a file.)
  5. After changing, I will do a full build first.At this timing New TranslateJpEra.properties will be used.(We will make it a difference build from the next time onwards.)

trouble shooting

If it does not work, please check the following points.

  • Does wagbydesigner/bin/webpage/WEB - INF/src/TranslateJpEra.properties have changed to the date on which the batch file in the above 3 was executed?
  • After full build, is wagbyapp/webapps/$ (project identifier) ​​/WEB-INF/classes/TranslateJpEra.properties the same file as above?

Input control> date/time> option display (date)

Edit the common.js file in the wagbydesigner/bin/webpage/system folder.
Please add new era values ​​to the variables wareki_date_a, wareki_regexp_a, wareki_fullname_a, wareki_shortchar_a.

var wareki_date_a = new Array(
      new Date(1868,  9-1,  8), new Date(1912,  7-1, 30),
      new Date(1926, 12-1, 25), new Date(1989,  1-1,  8));
var wareki_regexp_a = new Array(
      new RegExp("明[治]?", "g"),
      new RegExp("大[正]?", "g"),
      new RegExp("昭[和]?", "g"),
      new RegExp("平[成]?", "g"));
var wareki_fullname_a = new Array("明治", "大正", "昭和", "平成");
var wareki_shortcharpattern_a = new Array("Mm", "Tt", "Ss", "Hh");
After changing these two files (TranslateJpEra.properties, common.js), please do a full build.

Responding by upgrading Wagby

Modification of the above file will be included in Wagby which is shipped (version upgraded) after the era changed.If you can use version upgrade, the above correction work is unnecessary.

Output Control> Format

Replaced with TranslateJpEra.properties.UTF8 String rule is described.The standards are as follows.

replacePattern.0=平成1年;平成元年
replacePattern.1=昭和1年;昭和元年
replacePattern.2=大正1年;大正元年
replacePattern.3=明治1年;明治元年

Replace the semicolon as a delimiter and the left string with the right one.

Customize

(Example 1) Delete the above 4 lines if not writing the first year.

(Example 2) "First Year" will be displayed as "Original Year" by adding the following line.

replacePatetrn.4=平1年;平元年

When you corrected the TranslateJpEra.properties.UTF8 file,Add era namePlease follow the procedure of "Please do.

Input control> date/time> option display (date)

It is controlled by the common.js file in the wagbydesigner/bin/webpage/system folder.Specifically, it is done with the replaceFirstYearOfImperialEra function.

If you set the value of the global variable isReplaceFirstYearOfImperialEra to false, it does not display the first year.