I am trying to create a to-do app in react-redux, in that I want to compare date and time if date and time exceed the current date, then I want to pass data to pastReminders otherwise remain in upcoming reminders how should I update the react part and in this I am required to update state in redux also.
I am not getting the approach for this. I have reminders on an array of the object where all my data is stored.Till now I have done this:
const { reminders } = this.props;
reminders.forEach(function (data) {
var userTime = data.scheduled_datetime;
var now = moment().format();
if(userTime > now ) {
var userId = data.id;
console.log(userId);
}