How can i take the value of the month of the variable CreatedAt

I have the collection orders
and i want to take month and year of the variable “createdAt” ;
i use momentsjs in the app.

orders.createdAt

I would use

moment(orders.createdAt).format("MM/YYYY");

1 Like

google: "js Date"
See all the Date functions here
Maybe use these: getMonth, getFullYear.

1 Like