MomentJS - Date du mois

Cette méthode obtiendra / définira le jour du mois. Il prend une entrée de 1 à 31, s'il est supérieur à la plage fournie, il s'ajoutera au mois suivant.

Syntaxe

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

Exemple

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

Production