Article Number:010209
By configuring the DATE_FORMAT function or IF function, you can display the dates entered in a "Date" field in the Japanese calendar format.
○Preparation
Place the following fields in the form of the app settings and set field names, field codes, and formulas for each.
- Date Field
・Field Name/Field Code: Date
- Calculated Field
・Field Name/Field Code: Year
・Formula: DATE_FORMAT(Date, "YYYY", "system")
・Show As: Number (1000)
- Calculated Field
・Field Name/Field Code: Date_YYYYMMdd
・Formula: DATE_FORMAT(Date,"YYYYMMdd", "system")
・Show As: Number (1000)
- Text field
・Field Name/Field Code: Japanese calendar date
・Formula:DATE_FORMAT(Date, "MMMM d, ", "system") &
IF(Date_YYYYMMdd >= 20190501, "Reiwa " & Year-2018,
IF(Date_YYYYMMdd >= 19890108, "Heisei " & Year-1988,
"Showa " & Year-1925))
※ The "Year" and "Date_YYYYMMdd" fields can be hidden by configuring field permissions.
Even if field permissions are set, the "JapaneseCalendarYearMonthDate" field will be calculated correctly.
Configuring Permissions for Fields
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.
For reference, we have attached the template file "japanese_calendar.zip" (Japanese only) with the formula configured.
Download the template file, and without unzipping it, import it into kintone.
Creating Apps from Template Files
<References>
- DATE_FORMAT Function: Specifying the Display Format of Date and Time
- IF Function: Change the Value to Display Depending on a Condition