-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
fix: use getTimeFormat for encounter date of service datetime picker #7203
Changes from 10 commits
eb8a742
5b4a5af
841a830
b2b0abf
e8dc5fc
c1aaf9b
48d33ba
02dbc52
69466f2
be7ee0e
3c11fc8
3a7d362
3202bbd
24b70be
27de07f
3df6c91
4dadfbf
0bede03
ec6a1c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -202,7 +202,7 @@ function provide_sum_pat(patient_id,encounter_id) { | |
<?php echo xlt('Begin Date'); ?>: | ||
</td> | ||
<td> | ||
<input type='text' name='form_begin_date' id="form_begin_date" size='20' value='<?php echo attr(oeFormatDateTime($begin_date, 0, true)); ?>' class='datepicker form-control' /> | ||
<input type='text' name='form_begin_date' id="form_begin_date" size='20' value='<?php echo attr(oeFormatDateTime($begin_date, $GLOBALS['time_display_format'], true)); ?>' class='datepicker form-control' /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. in cases where you need to use the 2nd parameter (since need to set the second parameter to true, would just use the '"global" string instead of the actual global) |
||
</td> | ||
</tr> | ||
|
||
|
@@ -211,7 +211,7 @@ function provide_sum_pat(patient_id,encounter_id) { | |
<?php echo xlt('End Date'); ?>: | ||
</td> | ||
<td> | ||
<input type='text' name='form_end_date' id="form_end_date" size='20' value='<?php echo attr(oeFormatDateTime($end_date, 0, true)); ?>' class='datepicker form-control' /> | ||
<input type='text' name='form_end_date' id="form_end_date" size='20' value='<?php echo attr(oeFormatDateTime($end_date, $GLOBALS['time_display_format'], true)); ?>' class='datepicker form-control' /> | ||
</td> | ||
</tr> | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,6 +41,8 @@ | |
* @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. will need to ensure the new library/js/xl/jquery-datetimepicker-2-5-4-translated.js has same logic for the fixed time stuff |
||
*/ | ||
|
||
use OpenEMR\Services\Utils\DateFormatterUtils; | ||
|
||
?> | ||
i18n:{ | ||
en: { | ||
|
@@ -85,22 +87,27 @@ | |
<?php } ?> | ||
<?php if ($datetimepicker_timepicker) { ?> | ||
<?php if ($datetimepicker_showseconds) { ?> | ||
<?php if ($datetimepicker_formatInput) { ?> | ||
format: '<?php echo DateFormatRead("jquery-datetimepicker"); ?> H:i:s', | ||
<?php if ($datetimepicker_formatInput) { | ||
$time_format_with_secs = DateFormatterUtils::getTimeFormat(true); ?> | ||
format: '<?php echo DateFormatRead("jquery-datetimepicker") . " " . $time_format_with_secs; ?>', | ||
formatTime: '<?php echo $time_format_with_secs; ?>', | ||
validateOnBlur: false, | ||
<?php } else { ?> | ||
format: 'Y-m-d H:i:s', | ||
formatTime: 'H:i:s', | ||
<?php } ?> | ||
<?php } else { ?> | ||
<?php if ($datetimepicker_formatInput) { ?> | ||
format: '<?php echo DateFormatRead("jquery-datetimepicker"); ?> g:i a', | ||
formatTime:'g:i a', | ||
<?php if ($datetimepicker_formatInput) { | ||
$time_format_without_secs = DateFormatterUtils::getTimeFormat(); ?> | ||
format: '<?php echo DateFormatRead("jquery-datetimepicker") . " " . $time_format_without_secs; ?>', | ||
formatTime: '<?php echo $time_format_without_secs; ?>', | ||
validateOnBlur: false, | ||
<?php } else { ?> | ||
format: 'Y-m-d H:i', | ||
<?php } ?> | ||
<?php } ?> | ||
timepicker:true, | ||
step: '30' | ||
step: 30 | ||
<?php } else { ?> | ||
<?php if ($datetimepicker_formatInput) { ?> | ||
format: '<?php echo DateFormatRead("jquery-datetimepicker"); ?>', | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note if follow oeFormatDateTime to oeFormatTime, no need to set the 2nd parameter (if defaults to 'global' which then uses $GLOBALS['time_display_format'])
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
note that when formatInput is used the entry needs to be standardized at some point before going into the daatabase (via the DateTimeToYYYYMMDDHHMMSS() function ).
This form also has a discrepancy in it's view.php for this date widget.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So 2 things happen for internat to work on the datetimes.
(rec checking out DateTimeToYYYYMMDDHHMMSS use in code to get an idea how it works)