Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 581: Specify datepickers date format in common/configuration.ini #582

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions common/common_directory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@

//Required for date picker
Date.firstDayOfWeek = 0;
Date.format = 'mm/dd/yyyy';


// 1 visible, 0 hidden
Expand Down
3 changes: 3 additions & 0 deletions licensing/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@
<script type="text/javascript" src="../js/plugins/jquery.datePicker-patched-for-i18n.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
Date.format = '<?php echo return_datepicker_date_format(); ?>';
</script>
</head>
<body id="licensing">
<noscript><font face='arial'><?php echo _("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 ");?><a href=""><?php echo _("try again");?></a>. </font></noscript>
Expand Down
3 changes: 3 additions & 0 deletions management/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@
<script type="text/javascript" src="../js/plugins/jquery.tooltip.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
Date.format = '<?php echo return_datepicker_date_format(); ?>';
</script>
</head>
<body>
<noscript><font face='arial'><?php echo _("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 ");?><a href=""><?php echo _("try again");?></a>. </font></noscript>
Expand Down
1 change: 1 addition & 0 deletions organizations/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
const CORAL_ILS_LINK=<?php echo $config->ils->ilsConnector ? 1 : 0; ?>
Date.format = '<?php echo return_datepicker_date_format(); ?>';
</script>

</head>
Expand Down
3 changes: 3 additions & 0 deletions reports/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<script type="text/javascript" src="../js/plugins/jquery.tooltip.js"></script>
<script type="text/javascript" src="js/plugins/jquery.floatThead.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
Date.format = '<?php echo return_datepicker_date_format(); ?>';
</script>
</head>
<body>
<?php echo "<noscript><font face=arial>" . _("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") . " <a href=''>" . _("try again") . "</a>. </font></noscript>";?>
3 changes: 3 additions & 0 deletions resources/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,9 @@
<script type="text/javascript" src="../js/plugins/jquery.datePicker-patched-for-i18n.js"></script>
<script type="text/javascript" src="../js/common.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
Date.format = '<?php echo return_datepicker_date_format(); ?>';
</script>
</head>
<body>
<noscript><font face='arial'><?php echo _("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 ");?><a href=""><?php echo _("try again");?></a>. </font></noscript>
Expand Down
3 changes: 3 additions & 0 deletions usage/templates/header.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
?>
<script type="text/javascript" src="../js/plugins/translate.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript">
Date.format = '<?php echo return_datepicker_date_format(); ?>';
</script>
</head>
<body>
<noscript><font face='arial'><?php echo _("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 ");?><a href=""><?php echo _("try again");?></a>. </font></noscript>
Expand Down