The Widget allows for default dates to be pre-populated for the user using the following methods:
These methods accept a date in the yyyy-MM-dd format.
var snippet = new skyscanner.snippets.SearchPanelControl(); //setup dates snippet.setOutboundDate("2016-11-01"); snippet.setInboundDate("2016-11-15");
Alternatively, date deltas (number of days from today) can also be specified using the following methods:
These methods accept non-negative values.
var snippet = new skyscanner.snippets.SearchPanelControl(); //setup date deltas snippet.setOutboundDateDelta(28); snippet.setInboundDateDelta(35);
If the dates supplied are not within a valid range, defaults will be used in their place. The dates are deemed to be invalid if, the outbound or inbound dates are in the past or the inbound date is before the outbound date.
Note that browser quirks modes are not supported and in these cases the widgets will not load. This can be caused by a missing doctype in the hosting page.