Tuesday, February 28, 2017

Vue table dateColumns with laravel

I have a vue table, i'm using it in laravel. I want to show the created_at time in my table that is filterable and sortable. Laravels created at format is: 2017-02-27 20:20:58

If i pass that to my table the search bar is not displaying:

$(document).ready(function() {
new Vue({
    el: "#people",
    data: {
        columns: ['id', 'username', 'email', 'created_at', 'open'],

        options: {
            filterable: ['id', 'username', 'created_at', 'email'],
            sortable: ['id', 'username', 'created_at', 'email'],
            dateColumns: ['created_at']
        }
    }
});

});

If i use moment: dateColumns: [moment('created_at')] the filter works, but for string, i would need a datepicker. Also i get an error that: value provided is not in a recognized ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non ISO date formats are discouraged and will be removed in an upcoming major release

Any tips?

Thanks!




via user3844579

Advertisement