Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
more code review suggestions
Browse files Browse the repository at this point in the history
ankurjuneja committed Jan 10, 2025

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 685e10d commit 16344da
Showing 1 changed file with 4 additions and 23 deletions.
27 changes: 4 additions & 23 deletions resources/views/scheduleInstrument.html
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
<div id="instrumentOperatorDropDown"></div>
<br/>
<div id="paymentMethodDropDown"></div>
<a href="javascript:void(0);" id="addPaymentMethod">[Add Payment Method]</a>
<span id="addPaymentMethod" role="button" style="cursor: pointer;">[Add Payment Method]</span>
<br/>

</div>
@@ -248,32 +248,13 @@ <h3>Time Scheduled</h3>
// }
// });

function zeroPadded(val) {
if (val >= 10)
return val;
else
return '0' + val;
}

function editEvent(event) {
let startDate = event.startDate;
let endDate = event.endDate;
let startDateVal = startDate.getFullYear() + "-" +
zeroPadded(startDate.getMonth() + 1) + "-" +
zeroPadded(startDate.getDate()) + "T" +
zeroPadded(startDate.getHours()) + ":" +
zeroPadded(startDate.getMinutes()) + ":" +
zeroPadded(startDate.getSeconds());
let endDateVal = endDate.getFullYear() + "-" +
zeroPadded(endDate.getMonth() + 1) + "-" +
zeroPadded(endDate.getDate()) + "T" +
zeroPadded(endDate.getHours()) + ":" +
zeroPadded(endDate.getMinutes()) + ":" +
zeroPadded(endDate.getSeconds());

$('#event-modal input[name="event-index"]').val(event ? event.id : '');
$('#event-modal input[name="event-start-date"]').val(startDateVal);
$('#event-modal input[name="event-end-date"]').val(endDateVal);
$('#event-modal input[name="event-start-date"]').val(DateFormat.format.date(startDate, LABKEY.container.formats.dateTimeFormat));
$('#event-modal input[name="event-end-date"]').val(DateFormat.format.date(endDate, LABKEY.container.formats.dateTimeFormat));
$('#event-modal input[name="event-name"]').val(event ? event.name : '');
$('#event-modal input[name="event-notes"]').val(event ? event.notes : '');
$('#event-modal').modal();
@@ -397,7 +378,7 @@ <h3>Time Scheduled</h3>

// TODO: add delete icon
paymentMethodDropDown += '&nbsp' +
'<a href="javascript:void(0);" id="removePaymentMethod">[Remove]</a>';
'<span id="removePaymentMethod" role="button" style="cursor: pointer;">[Remove]</span>';
let logElt = document.createElement('div');
logElt.innerHTML = paymentMethodDropDown;

0 comments on commit 16344da

Please sign in to comment.