diff options
author | MaurĂcio Meneghini Fauth <mauricio@fauth.dev> | 2019-11-07 23:44:25 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-07 23:44:25 +0300 |
commit | 0ce7e21ed83f5fc2776354effa2b076c7beffe42 (patch) | |
tree | 0b963b62829d8a25e1741ef86c73b1b97cdca503 | |
parent | 57b213a982e38d4f735813d325e6e123c956a484 (diff) | |
parent | c28cd48ab4279827738d78c8132153ded3c5ddfc (diff) |
Merge pull request #14925 from saurass/issue-14909
Issue #14909 - Define the 1st day of week of the calendar in config.php
-rw-r--r-- | doc/config.rst | 10 | ||||
-rw-r--r-- | js/functions.js | 3 | ||||
-rw-r--r-- | js/makegrid.js | 3 | ||||
-rw-r--r-- | js/messages.php | 7 | ||||
-rw-r--r-- | js/server/status/monitor.js | 6 | ||||
-rw-r--r-- | libraries/classes/Config/Descriptions.php | 1 | ||||
-rw-r--r-- | libraries/classes/Config/Forms/User/FeaturesForm.php | 1 | ||||
-rw-r--r-- | libraries/config.default.php | 7 | ||||
-rw-r--r-- | libraries/config.values.php | 9 |
9 files changed, 43 insertions, 4 deletions
diff --git a/doc/config.rst b/doc/config.rst index 57facbac11..63f9c85f37 100644 --- a/doc/config.rst +++ b/doc/config.rst @@ -2874,6 +2874,16 @@ Design customization name of the column. The comment is shown as a tool-tip for that column. +.. config:option:: $cfg['FirstDayOfCalendar'] + + :type: integer + :default: 0 + + This will define the first day of week in the calendar. The number + can be set from 0 to 6, which represents the seven days of the week, + Sunday to Saturday respectively. This value can also be configured by the user + in server settings -> features -> general -> First Day calendar field. + Text fields ----------- diff --git a/js/functions.js b/js/functions.js index 3d7e42d1b0..d2d22fed91 100644 --- a/js/functions.js +++ b/js/functions.js @@ -214,7 +214,8 @@ Functions.addDateTimePicker = function () { showMillisec: showMillisec, showMicrosec: showMicrosec, timeFormat: timeFormat, - hourMax: hourMax + hourMax: hourMax, + firstDay: firstDayOfCalendar }); // Add a tip regarding entering MySQL allowed-values // for TIME and DATE data-type diff --git a/js/makegrid.js b/js/makegrid.js index b9b5a366f0..ed7a3b6a50 100644 --- a/js/makegrid.js +++ b/js/makegrid.js @@ -1076,7 +1076,8 @@ var makeGrid = function (t, enableResize, enableReorder, enableVisib, enableGrid Functions.addDatepicker($inputField, $td.attr('data-type'), { showMillisec: showMillisec, showMicrosec: showMicrosec, - timeFormat: timeFormat + timeFormat: timeFormat, + firstDay: firstDayOfCalendar }); $inputField.on('keyup', function (e) { diff --git a/js/messages.php b/js/messages.php index 71ab7ff8cd..ac0812d8f9 100644 --- a/js/messages.php +++ b/js/messages.php @@ -771,6 +771,13 @@ foreach ($js_messages as $name => $js_message) { Sanitize::printJsValue("Messages." . $name . "", $js_message); } +/* Calendar */ +echo "var themeCalendarImage = '" , $GLOBALS['pmaThemeImage'] + , 'b_calendar.png' , "';\n"; + +/* Calendar First Day */ +echo "var firstDayOfCalendar = '" , $GLOBALS['cfg']['FirstDayOfCalendar'] , "';\n"; + /* Image path */ echo "var pmaThemeImage = '" , $GLOBALS['pmaThemeImage'] , "';\n"; diff --git a/js/server/status/monitor.js b/js/server/status/monitor.js index ff058801d9..4540429f6f 100644 --- a/js/server/status/monitor.js +++ b/js/server/status/monitor.js @@ -1357,12 +1357,14 @@ AJAX.registerOnload('server/status/monitor.js', function () { Functions.addDatepicker($dateStart, 'datetime', { showMillisec: false, showMicrosec: false, - timeFormat: 'HH:mm:ss' + timeFormat: 'HH:mm:ss', + firstDay: firstDayOfCalendar }); Functions.addDatepicker($dateEnd, 'datetime', { showMillisec: false, showMicrosec: false, - timeFormat: 'HH:mm:ss' + timeFormat: 'HH:mm:ss', + firstDay: firstDayOfCalendar }); $dateStart.datepicker('setDate', min); $dateEnd.datepicker('setDate', max); diff --git a/libraries/classes/Config/Descriptions.php b/libraries/classes/Config/Descriptions.php index 181c2211a3..222fdd4f73 100644 --- a/libraries/classes/Config/Descriptions.php +++ b/libraries/classes/Config/Descriptions.php @@ -282,6 +282,7 @@ class Descriptions 'ForeignKeyMaxLimit_name' => __('Foreign key limit'), 'DefaultForeignKeyChecks_desc' => __('Default value for foreign key checks checkbox for some queries.'), 'DefaultForeignKeyChecks_name' => __('Foreign key checks'), + 'FirstDayOfCalendar_name' => __('First day of calendar'), 'Form_Browse_name' => __('Browse mode'), 'Form_Browse_desc' => __('Customize browse mode.'), 'Form_CodeGen_name' => 'CodeGen', diff --git a/libraries/classes/Config/Forms/User/FeaturesForm.php b/libraries/classes/Config/Forms/User/FeaturesForm.php index 93cc8ddd17..45af1ae539 100644 --- a/libraries/classes/Config/Forms/User/FeaturesForm.php +++ b/libraries/classes/Config/Forms/User/FeaturesForm.php @@ -32,6 +32,7 @@ class FeaturesForm extends BaseForm 'SendErrorReports', 'ConsoleEnterExecutes', 'DisableShortcutKeys', + 'FirstDayOfCalendar', ], 'Databases' => [ 'Servers/1/only_db', // saves to Server/only_db diff --git a/libraries/config.default.php b/libraries/config.default.php index 8a7db45c73..222e5c6fda 100644 --- a/libraries/config.default.php +++ b/libraries/config.default.php @@ -3249,6 +3249,13 @@ $cfg['DefaultTransformations']['DateFormat'] = [ ]; /** + * Set default for FirstDayOfCalendar + * + * @global integer $cfg['FirstDayOfCalendar'] + */ +$cfg['FirstDayOfCalendar'] = 0; + +/** * Default transformations for Inline * * @global array $cfg['DefaultTransformations']['Inline'] diff --git a/libraries/config.values.php b/libraries/config.values.php index efffbe971d..b7dbec9998 100644 --- a/libraries/config.values.php +++ b/libraries/config.values.php @@ -188,6 +188,15 @@ return [ 'closed' => __('Closed'), 'disabled' => __('Disabled'), ], + 'FirstDayOfCalendar' => [ + '1' => __('Monday'), + '2' => __('Tuesday'), + '3' => __('Wednesday'), + '4' => __('Thursday'), + '5' => __('Friday'), + '6' => __('Saturday'), + '7' => __('Sunday'), + ], 'SendErrorReports' => [ 'ask' => __('Ask before sending error reports'), 'always' => __('Always send error reports'), |