diff --git a/Documentation/Form.rst b/Documentation/Form.rst index ec71de3f7552331c94e8df574e0a535bbfae73a2..37f03ac115386aafa52f1ca1d98dbba1f3cdb438 100644 --- a/Documentation/Form.rst +++ b/Documentation/Form.rst @@ -1289,7 +1289,9 @@ Type: date * Range datetime: '1000-01-01' to '9999-12-31' or '0000-00-00'. (http://dev.mysql.com/doc/refman/5.5/en/datetime.html) * Optional: - * *FormElement.parameter.dateFormat*: yyyy-mm-dd | dd.mm.yyyy + * *FormElement.parameter.dateFormat*: YYYY-MM-DD | DD.MM.YYYY + +Actually datetimepicker is used as default. For more options see :ref:`Installation_datetimepicker` Type: datetime ^^^^^^^^^^^^^^ @@ -1299,10 +1301,11 @@ Type: datetime * *FormElement.parameter*: - * *dateFormat* = yyyy-mm-dd | dd.mm.yyyy + * *dateFormat* = YYYY-MM-DD | DD.MM.YYYY * *showSeconds* = 0|1 - shows the seconds. Independent if the user specifies seconds, they are displayed '1' or not '0'. * *showZero* = 0|1 - For an empty timestamp, With '0' nothing is displayed. With '1' the string '0000-00-00 00:00:00' is displayed. +Actually datetimepicker is used as default. For more options see :ref:`Installation_datetimepicker` Type: extra ^^^^^^^^^^^ @@ -1944,6 +1947,7 @@ Type: time * *showSeconds* = `0|1` - shows the seconds. Independent if the user specifies seconds, they are displayed '1' or not '0'. * *showZero* = `0|1` - For an empty timestamp, With '0' nothing is displayed. With '1' the string '00:00[:00]' is displayed. +Actually datetimepicker is used as default. For more options see :ref:`Installation_datetimepicker` .. _`input-upload`: Type: upload diff --git a/Documentation/Installation.rst b/Documentation/Installation.rst index 4a0196abccd1899a2eda9ec2e8b90a967b19f9a9..e8bb8d3083d24d5542da494f02058bfe710b53f6 100644 --- a/Documentation/Installation.rst +++ b/Documentation/Installation.rst @@ -293,6 +293,19 @@ As first option both can be inserted to the setup of the main Template like the Second option is to use the UZH CD template. +Following configurations can be set over FormElement.parameter: + +dateFormat = *DD.MM.YYYY HH:mm:ss* | *MM-DD-YYYY HH:mm* | *dddd DD.MM.YYYY HH:mm* -> DD:day of month,MM:month value,YYYY:year value,HH:24h,hh:12h AM-PM,mm:minutes,ss:seconds,dddd:written day of week +dateDaysOfWeekEnabled = *0,1,6* -> 0:sunday,1:monday,2:tuesday,3:wednesday,4:thursday,5:friday,6:saturday +dateLocale = *en* | *de* -> Set language +min = *03.05.2022* -> minDate that can be selected +max = *23.07.2022* -> maxDate that can be selected +dateViewModeDefault = *days* | *months* | *years* +clearMe = *0* | *1* -> show clear button +dateShowCalendarWeeks = *false* | *true* +dateUseCurrentDatetime = *false* | *true* +datetimeSideBySide = *false* | *true* -> Show time right to date + .. _form-editor: FormEditor diff --git a/javascript/src/Main.js b/javascript/src/Main.js index 3c64c71828a4cf40ea4b638673c508248c2ce5d1..51a4e736f4cabe7cc93406401a66acd42738251d 100644 --- a/javascript/src/Main.js +++ b/javascript/src/Main.js @@ -128,11 +128,12 @@ $(document).ready( function () { $('.qfq-datepicker').each(function() { var dates = {}; var datesToFormat = ["minDate", "maxDate"]; + var correctAttributeNames = ["mindate", "maxdate"]; for(var i = 0; i < datesToFormat.length; i++) { var date = false; - if($(this).data(datesToFormat[i])) { - var dateArray = $(this).data(datesToFormat[i]).split("."); - date = dateArray[1] + "." + dateArray[0] + "." + dateArray[2]; + if($(this).data(correctAttributeNames[i])) { + var dateArray = $(this).data(correctAttributeNames[i]).split("."); + date = dateArray[1] + "/" + dateArray[0] + "/" + dateArray[2]; } dates[datesToFormat[i]] = date; } @@ -147,7 +148,9 @@ $(document).ready( function () { showClear: ($(this).data("show-clear-button") !== undefined) ? $(this).data("show-clear-button") : true, calendarWeeks: ($(this).data("show-calendar-weeks") !== undefined) ? $(this).data("show-calendar-weeks") : false, useCurrent: ($(this).data("use-current-datetime") !== undefined) ? $(this).data("use-current-datetime") : false, - sideBySide: ($(this).data("datetime-side-by-side") !== undefined) ? $(this).data("datetime-side-by-side") : false + sideBySide: ($(this).data("datetime-side-by-side") !== undefined) ? $(this).data("datetime-side-by-side") : false, + minDate: dates.minDate, + maxDate: dates.maxDate }; var currentDatePicker = $(this).datetimepicker(options);