Skip to content

Commit 3171d6f

Browse files
committed
fix(VDataTable): convert dates to timestamps before sorting
fixes #13829
1 parent 4cc80ca commit 3171d6f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: packages/vuetify/src/util/helpers.ts

+5
Original file line numberDiff line numberDiff line change
@@ -339,6 +339,11 @@ export function sortItems<T extends any = any> (
339339
continue
340340
}
341341

342+
// Dates should be compared numerically
343+
if (sortA instanceof Date && sortB instanceof Date) {
344+
return sortA.getTime() - sortB.getTime()
345+
}
346+
342347
[sortA, sortB] = [sortA, sortB].map(s => (s || '').toString().toLocaleLowerCase())
343348

344349
if (sortA !== sortB) {

0 commit comments

Comments
 (0)