Goal: On load of mobile page show events where the Date__c field is today. Swipe left to see events for the next day; swipe right to see events for the previous day.
Since the mobile page builder doesn’t have tables and filters, I’m using javascript to interact with a condition on the model. The model starts with filterable condition Date__c = ‘TODAY’
I wrote the following nextDay snippet:
var model = skuid.$M('ApptInteractions'),<br> condition = model.getConditionByName('Date'),<br> curDate = condition.value;<br> <br>var jsDate = skuid.time.parseSFDate(curDate);<br>jsDate.setDate(jsDate.getDate()+1);<br>var nextDate = skuid.time.getSFDate(jsDate); <br>model.setCondition(condition, nextDate);<br>model.updateData();
The problem I’m running into is that condition.value = ‘TODAY’, which apparently is not a date. So I end up with jsDate = FALSE.
I could use the Date__c field from the first row in the model to get curDate, but there may be a situation where there aren’t any rows in the model, and I still want to be able to see the new and previous.
Anyone see a way around this?