@brightspace-ui/intl 3.5.0 → 3.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/lib/common.js +5 -0
- package/lib/number.js +0 -1
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ const date = formatDateTime(
|
|
|
95
95
|
Options:
|
|
96
96
|
- **format**: pattern to use when rendering the date-time; default is `'short'`.
|
|
97
97
|
- **full**: long weekday, month names and timezone. e.g. `'Wednesday, September 23, 2015 1:25 PM EST'`
|
|
98
|
-
- **medium**:
|
|
98
|
+
- **medium**: short month names. e.g. `'Sept 23, 2015 1:25 PM'`
|
|
99
99
|
- **short**: abbreviated date format. e.g. `'9/23/2015 1:25 PM'`
|
|
100
100
|
|
|
101
101
|
To format a **timestamp** as a date and time:
|
|
@@ -226,7 +226,7 @@ Contributions are welcome, please submit a pull request!
|
|
|
226
226
|
|
|
227
227
|
## Versioning & Releasing
|
|
228
228
|
|
|
229
|
-
> TL;DR: Commits prefixed with `fix:` and `feat:` will trigger patch and minor releases when merged to `
|
|
229
|
+
> TL;DR: Commits prefixed with `fix:` and `feat:` will trigger patch and minor releases when merged to `main`. Read on for more details...
|
|
230
230
|
|
|
231
231
|
The [sematic-release GitHub Action](https://github.com/BrightspaceUI/actions/tree/master/semantic-release) is called from the `release.yml` GitHub Action workflow to handle version changes and releasing.
|
|
232
232
|
|
package/lib/common.js
CHANGED
|
@@ -121,6 +121,7 @@ class DocumentLocaleSettings {
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
this._overrides = val;
|
|
124
|
+
this._listeners.forEach((cb) => cb());
|
|
124
125
|
}
|
|
125
126
|
|
|
126
127
|
addChangeListener(cb) {
|
|
@@ -151,6 +152,7 @@ class DocumentLocaleSettings {
|
|
|
151
152
|
}
|
|
152
153
|
|
|
153
154
|
_handleObserverChange(mutations) {
|
|
155
|
+
let localeAttributeChange = false;
|
|
154
156
|
for (let i = 0; i < mutations.length; i++) {
|
|
155
157
|
const mutation = mutations[i];
|
|
156
158
|
if (mutation.attributeName === 'lang') {
|
|
@@ -161,10 +163,13 @@ class DocumentLocaleSettings {
|
|
|
161
163
|
this.overrides = this._tryParseHtmlElemAttr('data-intl-overrides', {});
|
|
162
164
|
} else if (mutation.attributeName === 'data-timezone') {
|
|
163
165
|
this.timezone = this._tryParseHtmlElemAttr('data-timezone', { name: '', identifier: '' });
|
|
166
|
+
localeAttributeChange = true;
|
|
164
167
|
} else if (mutation.attributeName === 'data-oslo') {
|
|
165
168
|
this.oslo = this._tryParseHtmlElemAttr('data-oslo', { batch: null, collection: null, version: null });
|
|
169
|
+
localeAttributeChange = true;
|
|
166
170
|
}
|
|
167
171
|
}
|
|
172
|
+
if (localeAttributeChange) this._listeners.forEach((cb) => cb());
|
|
168
173
|
}
|
|
169
174
|
|
|
170
175
|
_normalize(langTag) {
|
package/lib/number.js
CHANGED
|
@@ -190,7 +190,6 @@ function formatDecimal(value, options) {
|
|
|
190
190
|
const strValue = new Intl.NumberFormat(
|
|
191
191
|
'en-US',
|
|
192
192
|
{
|
|
193
|
-
signDisplay: 'never',
|
|
194
193
|
maximumFractionDigits: options.maximumFractionDigits,
|
|
195
194
|
minimumFractionDigits: options.minimumFractionDigits,
|
|
196
195
|
useGrouping: false
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@brightspace-ui/intl",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"description": "Internationalization APIs for number, date, time and file size formatting and parsing in D2L Brightspace.",
|
|
5
5
|
"main": "lib/number.js",
|
|
6
6
|
"scripts": {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
"chai": "^4",
|
|
41
41
|
"concurrently": "^6",
|
|
42
42
|
"eslint": "^7",
|
|
43
|
-
"eslint-config-brightspace": "^0.
|
|
43
|
+
"eslint-config-brightspace": "^0.16",
|
|
44
44
|
"eslint-plugin-html": "^6",
|
|
45
45
|
"eslint-plugin-sort-class-members": "^1",
|
|
46
|
-
"http-server": "^0
|
|
47
|
-
"mocha": "^
|
|
46
|
+
"http-server": "^14.0",
|
|
47
|
+
"mocha": "^9",
|
|
48
48
|
"mocha-headless-chrome": "^3"
|
|
49
49
|
}
|
|
50
50
|
}
|