Valid until Datebox now Automatically filled in in Edit Quote details
Closes #37
This commit is contained in:
parent
02c06f7dff
commit
ece580583d
|
|
@ -40,7 +40,7 @@ switch($docType) {
|
||||||
<div id="editLineItemModal" title="Edit Line Item">
|
<div id="editLineItemModal" title="Edit Line Item">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="QuoteDetails">
|
<div id="QuoteDetails" title="Edit Quote Details">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,14 +2,6 @@
|
||||||
$(function() {
|
$(function() {
|
||||||
$("button").button();
|
$("button").button();
|
||||||
|
|
||||||
$('#date_issued_display').datepicker({
|
|
||||||
showButtonPanel: true,
|
|
||||||
dateFormat: 'd M yy',
|
|
||||||
altFormat: 'yy-mm-dd',
|
|
||||||
altField: '#date_issued'
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$('#valid_until_display').datepicker({
|
$('#valid_until_display').datepicker({
|
||||||
showButtonPanel: true,
|
showButtonPanel: true,
|
||||||
|
|
@ -19,6 +11,25 @@
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#date_issued_display').datepicker({
|
||||||
|
showButtonPanel: true,
|
||||||
|
dateFormat: 'd M yy',
|
||||||
|
altFormat: 'yy-mm-dd',
|
||||||
|
altField: '#date_issued',
|
||||||
|
onSelect: function(date, inst) {
|
||||||
|
issueDate = $('#date_issued_display').datepicker("getDate");
|
||||||
|
daysValid = $("#QuoteDaysValid").val();
|
||||||
|
validUntilDate = new Date();
|
||||||
|
daysValid = parseInt(issueDate.getDate()) + parseInt(daysValid);
|
||||||
|
validUntilDate.setFullYear(issueDate.getFullYear(), issueDate.getMonth(), daysValid);
|
||||||
|
$("#valid_until_display").datepicker("setDate", validUntilDate);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue