From ba20e837a13e21294f981edd9441dcbfd2e829a2 Mon Sep 17 00:00:00 2001 From: Matthias Meusburger Date: Thu, 25 Apr 2019 15:55:54 +0200 Subject: [PATCH] Issue 581: Specify datepickers date format in common/configuration.ini Datepickers date format can be specified in common/configuration.ini, as such: [settings] datepicker_date_format = "dd/mm/yyyy"; If datepicker_date_format is omitted, it will be defaulted to 'mm/dd/yyyy' --- common/common_directory.php | 11 +++++++++++ js/common.js | 1 - licensing/templates/header.php | 3 +++ management/templates/header.php | 3 +++ organizations/templates/header.php | 1 + reports/templates/header.php | 3 +++ resources/templates/header.php | 3 +++ usage/templates/header.php | 3 +++ 8 files changed, 27 insertions(+), 1 deletion(-) diff --git a/common/common_directory.php b/common/common_directory.php index 5a44fe4a6..020dc4edc 100644 --- a/common/common_directory.php +++ b/common/common_directory.php @@ -74,6 +74,17 @@ function return_date_format() { return $date_format; } +function return_datepicker_date_format() { + $config = new Configuration(); + $config_date_format = $config->settings->datepicker_date_format; + if (isset($config_date_format) && $config_date_format != '') { + $date_format = $config_date_format; + } else { + $date_format = "mm/dd/yyyy"; + } + return $date_format; +} + function format_date($mysqlDate) { //see http://php.net/manual/en/function.date.php for options diff --git a/js/common.js b/js/common.js index fa1aea256..83081cc08 100644 --- a/js/common.js +++ b/js/common.js @@ -34,7 +34,6 @@ //Required for date picker Date.firstDayOfWeek = 0; -Date.format = 'mm/dd/yyyy'; // 1 visible, 0 hidden diff --git a/licensing/templates/header.php b/licensing/templates/header.php index bfaec75cd..86f29acaf 100644 --- a/licensing/templates/header.php +++ b/licensing/templates/header.php @@ -81,6 +81,9 @@ + diff --git a/management/templates/header.php b/management/templates/header.php index 4142af7ee..d21e8b7da 100644 --- a/management/templates/header.php +++ b/management/templates/header.php @@ -80,6 +80,9 @@ + diff --git a/organizations/templates/header.php b/organizations/templates/header.php index 5e2cd0edd..c240e5ea3 100644 --- a/organizations/templates/header.php +++ b/organizations/templates/header.php @@ -76,6 +76,7 @@ diff --git a/reports/templates/header.php b/reports/templates/header.php index 9e720d20c..53afbd26f 100644 --- a/reports/templates/header.php +++ b/reports/templates/header.php @@ -67,6 +67,9 @@ + " . _("JavaScript must be enabled in order for you to use CORAL. However, it seems JavaScript is either disabled or not supported by your browser. To use CORAL, enable JavaScript by changing your browser options, then") . " " . _("try again") . ". ";?> diff --git a/resources/templates/header.php b/resources/templates/header.php index f18445662..d5d36aa8c 100644 --- a/resources/templates/header.php +++ b/resources/templates/header.php @@ -72,6 +72,9 @@ + diff --git a/usage/templates/header.php b/usage/templates/header.php index b78b2fa78..6b55a0846 100755 --- a/usage/templates/header.php +++ b/usage/templates/header.php @@ -67,6 +67,9 @@ ?> +