Skip to content

Commit

Permalink
Merge pull request #103 from m1kl/91-multiple-orders-with-date-second…
Browse files Browse the repository at this point in the history
…-item-is-reversed

Fixed date comparison in default comparator
  • Loading branch information
VadimDez authored Aug 10, 2020
2 parents f123b78 + 4db478f commit fd6a8d7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/app/order-pipe/ngx-order.pipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit fd6a8d7

Please sign in to comment.