Skip to content

Commit

Permalink
server: Fix build errors
Browse files Browse the repository at this point in the history
  • Loading branch information
eliandoran committed Oct 11, 2024
1 parent 0ec3232 commit bafc556
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/services/search/expressions/order_by_and_limit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ class OrderByAndLimitExp extends Expression {

notes.sort((a, b) => {
for (const {valueExtractor, smaller, larger} of this.orderDefinitions) {
let valA = valueExtractor.extract(a);
let valB = valueExtractor.extract(b);
let valA: string | number | Date | null = valueExtractor.extract(a);
let valB: string | number | Date | null = valueExtractor.extract(b);

if (valA === undefined) {
valA = null;
Expand Down Expand Up @@ -108,7 +108,7 @@ class OrderByAndLimitExp extends Expression {
}

isDate(date: number | string) {
return (new Date(date) !== "Invalid Date") && !isNaN(new Date(date));
return !isNaN(new Date(date).getTime());
}

isNumber(x: number | string) {
Expand Down

0 comments on commit bafc556

Please sign in to comment.