I have a Text component which I would like to show up once a day in my journal to divide logs from different days by using ternary operation. My guess was to use a JS date object which I named getDay, but it just returns me a current day every time after each log.
Here is my code:
{getDay ? (<Text style={{ marginLeft: 8, color: '#33466960', fontFamily: 'Montserrat' }}>{getDay}</Text>) : null}
My JS date object: const date = new Date(); const getDay = date.getDate();
My guess is that I need a different way to provide getDay with current date.