expire date based on deposit time
This commit is contained in:
@@ -93,12 +93,15 @@
|
||||
}
|
||||
|
||||
if (pdata['l_expire_type'] == '1') {
|
||||
var today = new Date();
|
||||
//var today = new Date();
|
||||
var today = new Date($('#mod_date').val());
|
||||
//var nextMonthBeginning = new Date(today.getFullYear(), today.getMonth() + 1, 1);
|
||||
var lastDayOfMonth = new Date(today.getFullYear(), today.getMonth()+1, 0);
|
||||
$('#expire_date').html(lastDayOfMonth.getFullYear() + '-' + ('0' + (lastDayOfMonth.getMonth()+1)).slice(-2) + '-' + ('0' + lastDayOfMonth.getDate()).slice(-2));
|
||||
}
|
||||
else if (pdata['l_expire_type'] == '2') {
|
||||
var today = new Date();
|
||||
//var today = new Date();
|
||||
var today = new Date($('#mod_date').val());
|
||||
var lastDayOfMonth = new Date(today.getFullYear(), today.getMonth()+1);
|
||||
$('#expire_date').html(lastDayOfMonth.getFullYear() + '-' + ('0' + (lastDayOfMonth.getMonth()+1)).slice(-2) + '-' + ('0' + today.getDate()).slice(-2));
|
||||
}
|
||||
@@ -108,4 +111,12 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).ready(function() {
|
||||
$('#mod_lease_l_id').trigger('change');
|
||||
});
|
||||
|
||||
$('#mod_date').on('change', function() {
|
||||
$('#mod_lease_l_id').trigger('change');
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user