Commit 7d89ed71 authored by Pavel Mashliakovskiy's avatar Pavel Mashliakovskiy 🤹🏻

force `numeric: true` for `Intl.Collator (correct sorting of numbers in non-en locale)

parent 8e45014f
Pipeline #21730 skipped with stage
...@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ...@@ -15,6 +15,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
### Removed ### Removed
### Fixed ### Fixed
- force `numeric: true` for `Intl.Collator(lang, { numeric: true })`. For `en` this is not necessary, but for `uk`
without forcing numeric numbers compared as strings.
## [5.5.0] - 2020-07-19 ## [5.5.0] - 2020-07-19
### Added ### Added
......
...@@ -177,7 +177,7 @@ function setDefaultLang (lang) { ...@@ -177,7 +177,7 @@ function setDefaultLang (lang) {
_collator = undefined _collator = undefined
if (lang === 'en') return if (lang === 'en') return
if ((typeof Intl === 'object') && Intl.Collator) { if ((typeof Intl === 'object') && Intl.Collator) {
_collator = new Intl.Collator(lang) _collator = new Intl.Collator(lang, { numeric: true })
} }
} }
setDefaultLang('en') setDefaultLang('en')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment