From 4db478f81ba6d0ffa4feeb973430da1d84153313 Mon Sep 17 00:00:00 2001 From: Michael Pinheiro Date: Sun, 9 Aug 2020 23:51:31 +0100 Subject: [PATCH] Fixed date comparison in default comparator --- src/app/order-pipe/ngx-order.pipe.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/order-pipe/ngx-order.pipe.ts b/src/app/order-pipe/ngx-order.pipe.ts index 8b0f3cd..a657a81 100644 --- a/src/app/order-pipe/ngx-order.pipe.ts +++ b/src/app/order-pipe/ngx-order.pipe.ts @@ -34,6 +34,10 @@ export class OrderPipe implements PipeTransform { * @param b */ static defaultCompare(a: any, b: any) { + if (a instanceof Date) { + a = a.getTime(); + b = b.getTime(); + } if (a === b) { return 0; }