You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(pinia-orm): support Intl.Collator for locale aware sorting
orderBy() (query & repository), useSortBy and the orderBy util now
accept an Intl.Collator besides the existing sort flags. String values
are then compared with the collator, enabling locale aware ordering
(e.g. Lithuanian A, B, Š, T, U) and options like numeric sorting.
Different flags can be given per order clause.
closes#2006
The optional third argument accepts either one of the sort flags (`'SORT_REGULAR'`, `'SORT_FLAG_CASE'`) or any [`Intl.Collator`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Collator) instance. A collator is used to compare string values, which enables locale aware sorting as well as options like numeric ordering (`new Intl.Collator(undefined, { numeric: true })`).
37
+
29
38
## Typescript Declarations
30
39
31
40
````ts
32
-
function orderBy(field:OrderBy, direction:OrderDirection='asc'):Query
41
+
function orderBy(field:OrderBy, direction:OrderDirection='asc', flags:SortComparator='SORT_REGULAR'):Query
0 commit comments