Momentjs-locale

提供:Dev Guides
移動先:案内検索

MomentJS-ロケール

このメソッドは、ロケールを使用して期間を取得/設定するのに役立ちます。 humanizeで使用すると、locale()メソッドの出力に違いが見られます。

構文

moment.duration().locale();
moment.duration().locale(String);

var hi = moment.duration(1, "day").locale("hi").humanize();
var en = moment.duration(1, "minutes").locale("en").humanize();
var ja = moment.duration(1, "seconds").locale("ja").humanize();
var it = moment.duration(1, "hours").locale("it").humanize();
var marathi = moment.duration(1, "day").locale("mr").humanize();
var konkani = moment.duration(1, "day").locale("gom-latn").humanize();
var kn = moment.duration(1, "day").locale("kn").humanize();

出力

ロケール