Level 102
Personally I would just install momentjs to handle these things
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I am using the below javascript to display the data from the table. How to format the date and find the difference between two dates.
<script type="text/javascript">
$(function () {
var table = $('.data-table').DataTable({
processing: true,
serverSide: true,
ajax: {
url: "{{ route('job.jobhistory.index') }}",
data: function (d) {
d.job_status_name = $('#job_status_name').val(),
d.search = $('input[type="search"]').val()
}
},
columns: [{
data: 'job_enq_number',
name: 'job_enq_number'
},
{
data: 'job_cust_name',
name: 'job_cust_name'
},
{
data: 'job_cust_mobile',
name: 'job_cust_mobile'
},
{
data: 'job_item_type',
name: 'job_item_type'
},
{
data: 'job_item_brand',
name: 'job_item_brand'
},
{
data: 'job_type',
name: 'job_type'
},
{
data: 'job_enq_date',
name: 'job_enq_date'
},
{
data: 'job_ins_date',
name: 'job_ins_date'
},
{
data: 'job_work_date',
name: 'job_work_date'
},
{
data: 'job_completed_date',
name: 'job_completed_date'
},
{
data: 'job_invoice_date',
name: 'job_invoice_date'
},
{
data: 'job_invoice_number',
name: 'job_invoice_number'
},
{
data: 'job_status_name',
name: 'status'
},
]
});
$('#job_status_name').change(function () {
table.draw();
});
});
</script>
Please or to participate in this conversation.