MomentJS - Data del mese

Questo metodo otterrà / imposterà il giorno del mese. Prende l'input da 1 a 31, se superiore all'intervallo fornito verrà aggiunto al mese successivo.

Sintassi

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

Esempio

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

Produzione