Displaying Japanese Calendar Dates
To display Japanese calendar dates in kintone, it is necessary to convert the date using formulas or to use a plug-in or JavaScript customization.
This article explains how to use formulas to display a date entered in a Date field as a Japanese calendar date.
See below for how to configure the settings.
Fields to use
Open the App settings screen and add the following fields on your app form: a Date field, two Calculated fields, and a Text field.
Although you can specify any values for the field names and field codes, in this example we will use the following values.
-
Date field
Field name and field code: "Date" -
Calculated field 1
Field name and field code: "Year" -
Calculated field 2
Field name and field code: "Date (YYYYMMdd)" and "Date_YYYYMMdd" respectively -
Text field
Field name and field code: "Japanese calendar date" and "Japanese_calendar_date" respectively
Setting the formulas
Set the following formulas for the two Calculated fields and the Text field.
-
Calculated field 1
Field name: "Year" (Calculated field 1)
Formula: DATE_FORMAT(Date, "YYYY", "Etc/GMT")
Select Number (1000).
-
Calculated field 2
Field name: "Date (YYYYMMdd)" (Calculated field 2)
Formula: DATE_FORMAT(Date,"YYYYMMdd", "Etc/GMT")
Select Number (1000).
-
Text field
Field name: "Japanese calendar date" (The Text field)
Formula: Select Calculate automatically and set the following formula.
DATE_FORMAT(Date, "MMMM d, ", "Etc/GMT") &
IF(Date_YYYYMMdd >= 20190501, "Reiwa " & Year-2018,
IF(Date_YYYYMMdd >= 19890108, "Heisei " & Year-1988,
"Showa " & Year-1925))
When the settings above are configured, the Japanese calendar date corresponding to the entered date will be displayed in the "Japanese calendar date" field.
For example, when "March 14, 2022" is entered in the Date field, "March 14, Reiwa 4" is displayed in the "Japanese calendar date" field.
From the link below, you can download an app template with preconfigured formulas.
App template: japanese_calendar.zip (Available only in Japanese) |
---|
Reference: Using plug-ins
As an alternative to setting formulas, you can use plug-ins to display Japanese calendar dates.
For details, refer to the following page.
Japanese calendar date conversion plug-in