MichaelMcDonald
Posts: 640
|
Posted: 09/25/2015, 6:42 PM |
|
Kids don't try this at home...
CCS will make sure the date format is consistent with your locale settings and override this default and
this will bring on Year and Month selector and custom Year range...
in your js/jquery/datepicker/ccs-date-timepicker.js
(function ($) {
var dataParameterName = "ccsDateTimePicker";
var nativeGenerateHTML, nativeUpdateDatepicker, nativeShowDatepicker;
var defaults = {
dateFormat: 'MM/dd/yy hh:mm:ss tt', // See format options on https://github.com/jquery/globalize
showTime: true, // Visible Time
isWeekend: false,
changeMonth: true,
changeYear: true,
yearRange: "2007:2085",
showButtonPanel: true,
zIndex: 1005
};
_________________
Central Coast, NSW, Australia.
|
|
|
laneoc
Posts: 154
|
Posted: 09/14/2016, 10:53 AM |
|
This was very helpful, thanks MMcD. I used your tip and took a couple other dives into the options.
When code is generated for a specific field, the html code looks similar to this:
params["xxxFIELD_NAMExxxInlineDatePicker1"] = {
dateFormat: "ShortDate",
isWeekend: true };
You may control the Jquery Datepicker options at the individual field level by adding options here, too. Example:
params["xxxFIELD_NAMExxxInlineDatePicker1"] = {
dateFormat: "ShortDate",
yearRange: "2007:2085",
isWeekend: true };
Another example - control the range from which the user can select a date:
params["xxxFIELD_NAMExxxInlineDatePicker1"] = {
dateFormat: "ShortDate",
yearRange: "2007:2085",
minDate: "{calculated_value_for_min}",
maxDate: "{calculated_value_for_max}",
isWeekend: true };
Other options are documented well in the Jquery Datepicker pages.
Have fun.
Lane O.
_________________
Lane |
|
|
|