DB Docs
API Reference
- Core API Reference
- Collection
- createCollection
- liveQueryCollectionOptions
- createLiveQueryCollection
- createOptimisticAction
- createTransaction
- Electric DB Collection
- electricCollectionOptions
- Query DB Collection
- queryCollectionOptions
- RxDB DB Collection
- rxdbCollectionOptions
- PowerSync Collection
- powerSyncCollectionOptions
- createIndexedDB
- indexedDBCollectionOptions
- React Hooks
- useLiveQuery
AI/LLM: This documentation page is available in plain markdown format at/db/latest/docs/reference/functions/compareTemporalValues.md
compareTemporalValues
ts
function compareTemporalValues(a, b): number;Defined in: packages/db/src/utils/comparison.ts:312
Compare two Temporal values of the same type, returning -1, 0, or 1.
The tags check type agreement. Types without a static .compare (e.g. PlainMonthDay) throw instead of using text order.
Callers must ensure both arguments are Temporal objects; mixed types throw.
Parameters#
a#
unknown
b#
unknown
Returns#
number