I want to ensure that the user does not select an end date before the start date. In this scenario, both dates will already be populated (editing an existing row in a calendar pop-up).
I’m using the approach outlined here to use a custom field renderer to override a datepicker:
https://community.skuid.com/t/override-the-standard-date-picker?topic-reply-list%5Bsettings%5D%5Bfilter_by%5D=all
Specifically the minDate attribute as discussed here:https://community.skuid.com/t/how-to-disable-the-dates-in-datepicker
Here is the code for the custom field renderer:
var field = argumentsn0], sdate = argumentsn0].row.Start_Date__c; //datetime field<br> value = argumentsn1],<br> $ = skuid.$;<br>skuid.ui.fieldRenderersefield.metadata.displaytype]pfield.mode](field,value);<br>//convert to js date<br>var jsStartDate = skuid.time.parseSFDate(sdate);<br>console.log(jsStartDate);<br>if (field.mode==='edit'){<br> var dateInput = field.element.find('input.hasDatepicker');<br> dateInput.datepicker( "minDate", jsStartDate, true);<br> dateInput.datepicker("refresh");<br>}
The pop-up fails to display, and I get this error:Uncaught TypeError: Cannot read property ‘apply’ of undefined
I’ve searched this error, but cannot find anything applicable to this approach of modifying the datepicker.