diff --git a/src/views/datatable/DataTableDemo.vue b/src/views/datatable/DataTableDemo.vue index 6ebaa49fc..c0a99eb7e 100644 --- a/src/views/datatable/DataTableDemo.vue +++ b/src/views/datatable/DataTableDemo.vue @@ -14,7 +14,7 @@
+ paginatorTemplate="FirstPageLink PrevPageLink PageLinks NextPageLink LastPageLink CurrentPageReport RowsPerPageDropdown" :rowsPerPageOptions="[10,25,50]"> - + @@ -134,6 +134,33 @@ export default { mounted() { this.customerService.getCustomers().then(data => this.customers = data); }, + methods: { + filterDate(value, filter) { + if (filter === undefined || filter === null || (typeof filter === 'string' && filter.trim() === '')) { + return true; + } + + if (value === undefined || value === null) { + return false; + } + + return value === this.formatDate(filter); + }, + formatDate(date) { + let month = date.getMonth() + 1; + let day = date.getDate(); + + if (month < 10) { + month = '0' + month; + } + + if (day < 10) { + day = '0' + day; + } + + return date.getFullYear() + '-' + month + '-' + day; + } + }, components: { 'DataTableDoc': DataTableDoc, 'DataTableSubMenu': DataTableSubMenu