K
K
Krollik1232019-12-08 03:50:44
JavaScript
Krollik123, 2019-12-08 03:50:44

How to get the numbers of the current week, from Monday to Sunday?

How to get an array of current week numbers?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Belyaev, 2019-12-08
@bingo347

const d = new Date();
d.setDate(d.getDate() - (d.getDay() || 7) + 1);
console.log(d);
This is the last Monday, the rest of the days can be found by analogy

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question