I have a moment date object, and want to get the selected day number (0-6) or (1-7).
I tried this, but it doesn't work
var aaa = moment(date).day();
help me with this please
Define "doesn't work".
const date = moment("2015-07-02"); // Thursday Feb 2015 const dow = date.day(); console.log(dow);
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>
1.4m articles
1.4m replys
5 comments
57.0k users