mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Extending default locale list
Summary: Adding more locale codes to support more countries in document settings Test Plan: existing tests Reviewers: dsagal Reviewed By: dsagal Subscribers: dsagal Differential Revision: https://phab.getgrist.com/D3018
This commit is contained in:
@@ -487,6 +487,15 @@ export function nativeCompare<T>(a: T, b: T): number {
|
||||
return (a < b ? -1 : (a > b ? 1 : 0));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that compares objects by a property value.
|
||||
*/
|
||||
export function propertyCompare<T>(property: keyof T) {
|
||||
return function(a: T, b: T) {
|
||||
return nativeCompare(a[property], b[property]);
|
||||
};
|
||||
}
|
||||
|
||||
// TODO: In the future, locale should be a value associated with the document or the user.
|
||||
export const defaultLocale = 'en-US';
|
||||
export const defaultCollator = new Intl.Collator(defaultLocale);
|
||||
|
||||
Reference in New Issue
Block a user