Model and Render Conditions support TODAY for Date and DateTime comparisons (though TODAY doesn’t work in a Render Condition, but I see that bug was reported a few months ago). I have a need to be able to compare against NOW (including the current time) for DateTime objects and have been trying to implement that via a snippet.
I’ve got it working on a model condition where I set the condition to use a specific date/time in the designer, and then change the comparison value in the models condition array when the page loads. For example,
model.conditions[0].inactive = false;
model.conditions[0].value = (new Date()).toISOString();
model.updateData()
I’ve not had the same luck with conditional renders. I’ve found the component (such as $(‘#myComponent’).data(‘component’), or skuid.component.getById(‘myComponent’)), and in there I can find element.conditions … but the conditions array is empty even though I have a render condition on my component. So likely I’m looking in the wrong place?
How can I find the render condition in a snippet to change the comparison value?
And it would be great to see NOW as an available option in the list of conditions!
Thanks,
- Chris
Question
Need Model / Render Conditions to be accurate to time (hours/minutes) not just dates
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.