I'm making React app and I have such problem:
For instance, I have an array container
and it looks like this:
const container = [
{item: '1'},
{item: '2'},
{item: '3'},
{item: '4'}
]
Then I want to make in html 4 columns and each of them has one value fron this array.. So i'm using this:
<div>
{container.map(t =>
<div className='box'>{t.item}</div>
)}
</div>
So it'll make 4 div
with different values: 1/2/3/4
And now my question is here: how to make own date (starting from toda to ...) for every box
?
- First item = Monday, 8 June
- Second item = Tuesday, 9 June
etc.
I did something like this, but it shows only current day, bu I NEED to show the next days starting from today: 8,9,10,11 etc (the last date doesn't matter it can be 25 June)
let x = new Date();
let fullDate = x.toLocaleString('en-gb', { day:'numeric' , weekday: 'long', month: 'long' });
P.S. When I'm using for
It shows all dates in every column.
You can see example on the picture:
EVERY block has current day.. But I need [you can see above]
console.log: