I need to display a whole week from Monday To Sunday in following format "Week 2: 05.01 - 11.01" as an example
let d = new Date();
let date = d.getDate();
let day = d.getDay();
let currentWeek = Math.ceil((date + 6 - day) / 7);
this is what i have for the current week, i know that it will have some issues if the previous month is in the first week of the current month.
Any help as to how to make it accurate and reliable?
I need it to work in React Native!