import Ember from 'ember';
import _ from 'lodash';

export function isChecked(params) {
    var dates = params[0];
    if(dates == null) {
        return false;
    }

    var decade = _.range(params[1], params[1] + 10);

    var filter = decade.filter(function(date){ return dates.indexOf(date) > -1; });
    if(filter.length === decade.length) {
        return true;
    }
    return false;
}

export default Ember.Helper.helper(isChecked);
