@bbn/bbn 1.0.453 → 1.0.455
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/dist/bbn.js +1 -1
- package/dist/bbn.js.map +1 -1
- package/dist/date.js +3 -3
- package/dist/fn/datetime/fdatetime.js +0 -1
- package/package.json +1 -1
package/dist/date.js
CHANGED
|
@@ -334,7 +334,7 @@ class bbnDateTool {
|
|
|
334
334
|
return '';
|
|
335
335
|
}
|
|
336
336
|
const opt = Object.assign(Object.assign({ year: 'numeric', month: long ? 'long' : 'short', day: 'numeric' }, (weekday ? { weekday: 'long' } : {})), (withTime ? { hour: '2-digit', minute: '2-digit' } : {}));
|
|
337
|
-
const d = new Intl.DateTimeFormat(navigator.
|
|
337
|
+
const d = new Intl.DateTimeFormat([bbn.env.lang, ...navigator.languages], opt);
|
|
338
338
|
return d.format(__classPrivateFieldGet(this, _bbnDateTool_value, "f"));
|
|
339
339
|
}
|
|
340
340
|
ftime(withSeconds = false) {
|
|
@@ -348,7 +348,7 @@ class bbnDateTool {
|
|
|
348
348
|
if (withSeconds) {
|
|
349
349
|
opt.second = '2-digit';
|
|
350
350
|
}
|
|
351
|
-
const t = new Intl.DateTimeFormat(navigator.
|
|
351
|
+
const t = new Intl.DateTimeFormat([bbn.env.lang, ...navigator.languages], opt);
|
|
352
352
|
return t.format(__classPrivateFieldGet(this, _bbnDateTool_value, "f"));
|
|
353
353
|
}
|
|
354
354
|
format(format = 'y-m-d h:i:s') {
|
|
@@ -447,7 +447,7 @@ class bbnDateTool {
|
|
|
447
447
|
const date = new Date();
|
|
448
448
|
const chosenUnit = unitsCorrespondence[unit] || this.guessUnit(this.diff(date));
|
|
449
449
|
const diff = this.diff(date, chosenUnit);
|
|
450
|
-
const rtf = new Intl.RelativeTimeFormat(
|
|
450
|
+
const rtf = new Intl.RelativeTimeFormat([bbn.env.lang, ...navigator.languages], { numeric: "auto" });
|
|
451
451
|
// FORCED UNIT MODE
|
|
452
452
|
const match = bbn.fn.getRow(units, d => d[0] === chosenUnit);
|
|
453
453
|
if (!match) {
|
|
@@ -14,7 +14,6 @@ export default function fdatetime(d, wrong_result = false) {
|
|
|
14
14
|
return wrong_result && isString(wrong_result) ? wrong_result : '';
|
|
15
15
|
}
|
|
16
16
|
if (undefined !== dayjs) {
|
|
17
|
-
//return dayjs(r).format('lll');
|
|
18
17
|
return dayjs(r).calendar(null, {
|
|
19
18
|
sameDay: '[' + bbn._('Today') + '] HH:mm',
|
|
20
19
|
nextDay: '[' + bbn._('Tomorrow') + '] HH:mm',
|