Skip to content

Commit

Permalink
Issue #3483: Also set 'Used' checkbox for DateTime.
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanhaerter authored and svenoe committed Jun 18, 2024
1 parent 023392a commit c06e8a0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions var/httpd/htdocs/js/Core.UI.InputFields.js
Original file line number Diff line number Diff line change
Expand Up @@ -3144,12 +3144,19 @@ Core.UI.InputFields = (function (TargetNS) {
*/
TargetNS.SetDate = function ($Parent, DateString) {
var DateObj = new Date(DateString);

// set used checkbox
$Parent.find('input[type=checkbox][id$=Used]').attr('checked', DateString ? true : false);

// set date elements
var $YearElement = $Parent.find('select[id$=Year]');
$YearElement.val(DateObj.getFullYear());
var $MonthElement = $Parent.find('select[id$=Month]');
$MonthElement.val(DateObj.getMonth() + 1);
var $DayElement = $Parent.find('select[id$=Day]');
$DayElement.val(DateObj.getDate());

// set time elements
var $HourElement = $Parent.find('select[id$=Hour]');
if ( $HourElement.length ) {
$HourElement.val(DateObj.getHours());
Expand Down

0 comments on commit c06e8a0

Please sign in to comment.