Skip to content
Source
Sign inSign up
TanStack/db
Open History to see the last commit

compareTemporalValues.md

31 lines602 Bytes

1---
2id: compareTemporalValues
3title: compareTemporalValues
4---
5​
6```ts
7function compareTemporalValues(a, b): number;
8```
9​
10Defined in: [packages/db/src/utils/comparison.ts:312](https://github.com/TanStack/db/blob/main/packages/db/src/utils/comparison.ts#L312)
11​
12Compare two Temporal values of the same type, returning -1, 0, or 1.
13​
14The tags check type agreement. Types without a static `.compare` (e.g.
15`PlainMonthDay`) throw instead of using text order.
16​
17Callers must ensure both arguments are Temporal objects; mixed types throw.
18​
19## Parameters
20​
21### a
22​
23`unknown`
24​
25### b
26​
27`unknown`
28​
29## Returns
30​
31`number`