5 * This is to allow internationalization by OpenEMR of the jquery-datetimepicker.
6 * (with and without a time selector)
8 * Example code in script:
9 * $('.datetimepicker').datetimepicker({
10 * $datetimepicker_timepicker = true; (php variable)
11 * $datetimepicker_showseconds = false; (php variable)
12 * $datetimepicker_formatInput = false; (php variable)
13 * $datetimepicker_maxDate = '+1970/01/01' (php variable) `+1970/01/01` means today for tomorrow use `+1970/01/02`
14 * require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); (php command)
15 * can add any additional settings to datetimepicker here; need to prepend first setting with a comma
17 * $('.datepicker').datetimepicker({
18 * $datetimepicker_timepicker = false; (php variable)
19 * $datetimepicker_showseconds = false; (php variable)
20 * $datetimepicker_formatInput = false; (php variable)
21 * $datetimepicker_minDate = '-1970/01/01'; (php variable)
22 * require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); (php command)
23 * can add any additional settings to datetimepicker here; need to prepend first setting with a comma
26 * $datetimepicker_timepicker - this will set whether to use the timepicker
27 * $datetimepicker_showseconds - this will show seconds if using the timepicker
28 * $datetimepicker_formatInput - this will set whether to format the input to
29 * $datetimepicker_minDate - this will set the minimum date that can be selected
30 * $datetimepicker_maxDate - this will set the minimum date that can be selected
31 * the user selected date format within globals. (This works with the following functions to fully
32 * support internationalization of dates; note this setting does not yet work with the timepicker yet)
33 * -oeFormatShortDate() function for when placing a default formatted date in the field
34 * -DateToYYYYMMDD() function when insert the formatted date into database or codebase works on it
38 * @link http://www.open-emr.org
39 * @author Brady Miller <brady.g.miller@gmail.com>
40 * @copyright Copyright (c) 2017-2018 Brady Miller <brady.g.miller@gmail.com>
41 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
44 use OpenEMR\Services\Utils\DateFormatterUtils
;
50 <?php
echo xlj('January'); ?
>, <?php
echo xlj('February'); ?
>, <?php
echo xlj('March'); ?
>, <?php
echo xlj('April'); ?
>, <?php
echo xlj('May'); ?
>, <?php
echo xlj('June'); ?
>, <?php
echo xlj('July'); ?
>, <?php
echo xlj('August'); ?
>, <?php
echo xlj('September'); ?
>, <?php
echo xlj('October'); ?
>, <?php
echo xlj('November'); ?
>, <?php
echo xlj('December'); ?
>
53 <?php
echo xlj('Sun'); ?
>, <?php
echo xlj('Mon'); ?
>, <?php
echo xlj('Tue'); ?
>, <?php
echo xlj('Wed'); ?
>, <?php
echo xlj('Thu'); ?
>, <?php
echo xlj('Fri'); ?
>, <?php
echo xlj('Sat'); ?
>
55 dayOfWeek
: [<?php
echo xlj('Sunday'); ?
>, <?php
echo xlj('Monday'); ?
>, <?php
echo xlj('Tuesday'); ?
>, <?php
echo xlj('Wednesday'); ?
>, <?php
echo xlj('Thursday'); ?
>, <?php
echo xlj('Friday'); ?
>, <?php
echo xlj('Saturday'); ?
>
59 <?php
if (($_SESSION['language_direction'] ??
'') == 'rtl') { ?
>
61 * In RTL languages a datepicker popup is opened in left and it's cutted by the edge of the window
62 * This patch resolves that and moves a datepicker popup to right side.
64 onGenerate
:function(current_time
,$input){
66 var position
= $
($input).offset()
67 //width of date picke popup
68 var datepickerPopupWidth
= $
('.xdsoft_datetimepicker').width();
70 if(position
.left
< datepickerPopupWidth
){
71 $
('.xdsoft_datetimepicker').offset({left
:position
.left
});
73 //put a popup in the regular position
74 $
('.xdsoft_datetimepicker').offset({left
:position
.left
- datepickerPopupWidth + $
($input).innerWidth()});
81 rtl
: <?php
echo (($_SESSION['language_direction'] ??
'') == 'rtl') ?
"true" : "false"; ?
>,
82 <?php
if (!empty($datetimepicker_minDate)) { ?
>
83 minDate
: '<?php echo $datetimepicker_minDate; ?>',
85 <?php
if (!empty($datetimepicker_maxDate)) { ?
>
86 maxDate
: '<?php echo $datetimepicker_maxDate; ?>',
88 <?php
if ($datetimepicker_timepicker) { ?
>
89 <?php
if ($datetimepicker_showseconds) { ?
>
90 <?php
if ($datetimepicker_formatInput) {
91 $time_format_with_secs = DateFormatterUtils
::getTimeFormat(true); ?
>
92 format
: '<?php echo DateFormatRead("jquery-datetimepicker") . " " . $time_format_with_secs; ?>',
93 formatTime
: '<?php echo $time_format_with_secs; ?>',
94 validateOnBlur
: false,
96 format
: 'Y-m-d H:i:s',
100 <?php
if ($datetimepicker_formatInput) {
101 $time_format_without_secs = DateFormatterUtils
::getTimeFormat(); ?
>
102 format
: '<?php echo DateFormatRead("jquery-datetimepicker") . " " . $time_format_without_secs; ?>',
103 formatTime
: '<?php echo $time_format_without_secs; ?>',
104 validateOnBlur
: false,
112 <?php
if ($datetimepicker_formatInput) { ?
>
113 format
: '<?php echo DateFormatRead("jquery-datetimepicker"); ?>',