lundi 22 mai 2017

Ember.js if date variable has gone over current date

I'm new to ember.js and was creating a model, with a function. The model itself will hold data on a date, but I was creating another attribute as a boolean value, if the model date has gone over the current date I want the boolean value to represent as false.

It might be easier to understand if I show you an example:

title: DS.attr('string'),
date: DS.attr('date'),
live: DS.attr('boolean', { defaultValue:function () {
    if (date)
})}

So I want Live to equal true if date is below current date, I'm not sure or would this really go in the controller, because this variable will have to be constantly checked




Aucun commentaire:

Enregistrer un commentaire