Why checkbox not reactive as expected?


#1

After start_date is exceeded I expect checkbox to be true and hence checked on UI, but I still need to click refresh on browser to see the current checked state when

current time is > (this.props.futuretask.start_date).startOf(‘minute’) as in the following:

import React, {Component} from 'react';
import TrackerReact from 'meteor/ultimatejs:tracker-react';
var moment = require('moment');

export default class FutureTaskSingle extends TrackerReact(Component) {
    render() {
        return (

        <li>

            <input type="checkbox"
                   readOnly={true}
                   checked={(moment(this.props.futuretask.start_date).startOf('minute')).isBefore(moment().startOf('minute'))}/>

            {this.props.futuretask.number}
            {this.props.futuretask.assignment_group}
            {this.props.futuretask.start_date}
            {this.props.futuretask.end_date}
            {this.props.futuretask.userid}
            {this.props.futuretask.username}

        </li>
        )
    }
}

Or do I need to somehow do the calculation outside of scope, before the iteration?