Node.jsを使ったC++経由での日付を日本の日付に変換する

Contents
[ ]

Aspose.Cellsは、西暦日付を日本の元号に変換する方法を提供します。この変換では、元号の変化も考慮されます。次のコードスニペットは、西暦日付を含む源のExcelファイルを日本の和暦付きの出力PDFに変換します。画像の例も示します。

todo:image_alt_text

const path = require("path");
const AsposeCells = require("aspose.cells.node");

// Source directory
const sourceDir = path.join(__dirname, "data");

// Output directory
const outputDir = path.join(__dirname, "output");

const options = new AsposeCells.LoadOptions(AsposeCells.LoadFormat.Xlsx);
options.setLanguageCode(AsposeCells.CountryCode.Japan);
options.setRegion(AsposeCells.CountryCode.Japan);

const workbook = new AsposeCells.Workbook(path.join(sourceDir, "JapaneseDates.xlsx"), options);
workbook.save(outputDir + "JapaneseDates.pdf", AsposeCells.SaveFormat.Pdf);