Skip to content

Commit

Permalink
fix(data-store-json): order credentials with weird issuanceDate (#1273)
Browse files Browse the repository at this point in the history
  • Loading branch information
mirceanis committed Oct 13, 2023
1 parent a324b30 commit 28c65f7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/data-store-json/src/data-store-json.ts
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,9 @@ function buildQuery<T extends Partial<Record<PossibleColumns, any>>>(
const colA = a[col]
const colB = b[col]
if (typeof colA?.getTime === 'function') {
result = direction * (colA.getTime() - colB.getTime() || 0)
const aTime = colA.getTime()
const bTime = typeof colB?.getTime === 'function' ? colB.getTime() : 0
result = direction * (aTime - bTime || 0)
} else if (typeof colA?.localeCompare === 'function') {
result = direction * colA.localeCompare(colB)
} else {
Expand Down

0 comments on commit 28c65f7

Please sign in to comment.