Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@mysticatea

Node.js で令和元年 (full-icu + toLocaleDateString)。

More than 1 year has passed since last update.

Node.js はデフォルトでは日本語関連の ICU データを持っていないので、別途インストールする必要があります。

> npm i full-icu

で、これを指定して実行してあげましょう。

> node -v
v12.1.0
> node --icu-data-dir=node_modules/full-icu -p "new Date().toLocaleDateString('ja-JP-u-ca-japanese', { era: 'long' })"
令和元年5月1日
1
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
mysticatea
ESLint のメンテナ。Vue.js の開発チームメンバー。JavaScript 言語仕様書 ECMA-262 や JavaScript 構文解析器 Acorn のコントリビューター。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?