1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Set due date placeholder when selecting client

This commit is contained in:
Hillel Coren 2017-04-12 18:30:09 +03:00
parent 84f1cdf44e
commit 9f52dc7fe6

View File

@ -28,9 +28,10 @@ function ViewModel(data) {
if (paymentTerms == -1) paymentTerms = 0;
var dueDate = $('#invoice_date').datepicker('getDate');
dueDate.setDate(dueDate.getDate() + paymentTerms);
self.invoice().due_date(dueDate);
// We're using the datepicker to handle the date formatting
self.invoice().due_date($('#due_date').val());
dueDate = moment(dueDate).format("{{ $account->getMomentDateFormat() }}");
$('#due_date').attr('placeholder', dueDate);
} else {
$('#due_date').attr('placeholder', "{{ $invoice->exists || $invoice->isQuote() ? ' ' : $account->present()->dueDatePlaceholder() }}");
}
@endif
}