Skip to content

How can I compare dates in react-moment? #109

@pedroRelvas

Description

@pedroRelvas

In Moment.js I can compare dates just like this:

moment('2010-10-20').isAfter('2010-01-01', 'year');
But in react-moment I just can't find anything about the method `.isAfter. I want to compare the following values:

<TableCell>{ <Moment format="DD.MM.YYYY HH:mm">{row.nextIntervention}</Moment> isAfter <Moment format="DD.MM.YYYY HH:mm" /> ? <Moment format="DD.MM.YYYY">{row.nextIntervention.toString()}</Moment> : "heyhey"} </TableCell>
So as you can see, this code doesn't work (of course). Do you know anything that can hel me solve this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions