Momentjs-date-of-month

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

MomentJS-月の日付

このメソッドは、月の日を取得/設定します。 翌月に追加される範囲よりも大きい場合は、1〜31の入力を受け取ります。

構文

moment().date(Number);
moment().date();
moment().dates(Number);
moment().dates();

var m = moment().date();//gets the current day of the month
var d = moment().date(2);//sets the day of month as shown below
var k = moment().date(40);//sets the day of month which is greater than the
range so the output shows the next month as shown in the output

出力

月の日付