新しい元号(年号)への対応方法について
対象製品
SpreadJS 9J
詳細
SpreadJSでは、GC.Spread.Common.CultureInfo.eras により、和暦表示において新しい元号に対応することができます。
詳細は、製品ヘルプの「年号の書式設定」をご参照ください。
◎サンプルコード(javascript)
詳細は、製品ヘルプの「年号の書式設定」をご参照ください。
◎サンプルコード(javascript)
// 年号をカスタマイズします。
GC.Spread.Common.CultureInfo.eras = [
{name: "明治", abbreviation: "明", symbol: "M", startDate: "1868-09-08", shortcuts: "1,M"},
{name: "大正", abbreviation: "大", symbol: "T", startDate: "1912-07-30", shortcuts: "2,T"},
{name: "昭和", abbreviation: "昭", symbol: "S", startDate: "1926-12-25", shortcuts: "3,S"},
{name: "平成", abbreviation: "平", symbol: "H", startDate: "1989-01-08", shortcuts: "4,H"},
{name: "令和", abbreviation: "令", symbol: "R", startDate: "2019-05-01", shortcuts: "5,R"}
];
GC.Spread.Common.CultureInfo.eras = [
{name: "明治", abbreviation: "明", symbol: "M", startDate: "1868-09-08", shortcuts: "1,M"},
{name: "大正", abbreviation: "大", symbol: "T", startDate: "1912-07-30", shortcuts: "2,T"},
{name: "昭和", abbreviation: "昭", symbol: "S", startDate: "1926-12-25", shortcuts: "3,S"},
{name: "平成", abbreviation: "平", symbol: "H", startDate: "1989-01-08", shortcuts: "4,H"},
{name: "令和", abbreviation: "令", symbol: "R", startDate: "2019-05-01", shortcuts: "5,R"}
];