vueless 0.0.47 → 0.0.49
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/package.json
CHANGED
|
@@ -345,7 +345,7 @@ const isCurrentView = computed(() => ({
|
|
|
345
345
|
year: currentView.value === VIEW.year,
|
|
346
346
|
}));
|
|
347
347
|
|
|
348
|
-
const currentLocale = computed(() => merge(
|
|
348
|
+
const currentLocale = computed(() => merge(tm("UCalendar"), props.config.i18n));
|
|
349
349
|
|
|
350
350
|
const locale = computed(() => {
|
|
351
351
|
const { months, weekdays } = currentLocale.value;
|
|
@@ -367,16 +367,24 @@ const locale = computed(() => {
|
|
|
367
367
|
const userFormatLocale = computed(() => {
|
|
368
368
|
const { months, weekdays } = currentLocale.value;
|
|
369
369
|
|
|
370
|
+
const monthsLonghand = props.config.i18n?.months?.userFormat
|
|
371
|
+
? months.userFormat
|
|
372
|
+
: months.longhand;
|
|
373
|
+
|
|
374
|
+
const weekdaysLonghand = props.config.i18n?.weekdays?.userFormat
|
|
375
|
+
? weekdays.userFormat
|
|
376
|
+
: weekdays.longhand;
|
|
377
|
+
|
|
370
378
|
// formatted locale
|
|
371
379
|
return {
|
|
372
380
|
...currentLocale,
|
|
373
381
|
months: {
|
|
374
382
|
shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
|
|
375
|
-
longhand: getSortedLocale(
|
|
383
|
+
longhand: getSortedLocale(monthsLonghand, LOCALE_TYPE.month),
|
|
376
384
|
},
|
|
377
385
|
weekdays: {
|
|
378
386
|
shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
|
|
379
|
-
longhand: getSortedLocale(
|
|
387
|
+
longhand: getSortedLocale(weekdaysLonghand, LOCALE_TYPE.day),
|
|
380
388
|
},
|
|
381
389
|
};
|
|
382
390
|
});
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
|
|
54
54
|
<script setup>
|
|
55
55
|
import { computed, nextTick, ref } from "vue";
|
|
56
|
+
import { merge } from "lodash-es";
|
|
56
57
|
|
|
57
58
|
import UInput from "../ui.form-input";
|
|
58
59
|
import UCalendar from "../ui.form-calendar";
|
|
@@ -258,7 +259,7 @@ function onBlur(event) {
|
|
|
258
259
|
function formatUserDate(data) {
|
|
259
260
|
if (props.dateFormat !== STANDARD_USER_FORMAT) return data;
|
|
260
261
|
|
|
261
|
-
const currentLocale =
|
|
262
|
+
const currentLocale = merge(tm("UDatePicker"), props.config.i18n);
|
|
262
263
|
|
|
263
264
|
let prefix = "";
|
|
264
265
|
const formattedDate = data.charAt(0).toUpperCase() + data.toLowerCase().slice(1);
|
|
@@ -415,7 +415,7 @@ const localValue = computed({
|
|
|
415
415
|
|
|
416
416
|
const isMobileDevice = computed(() => store.getters["breakpoint/isMobileDevice"]);
|
|
417
417
|
const rangeInputName = computed(() => `rangeInput-${props.id}`);
|
|
418
|
-
const currentLocale = computed(() => merge(
|
|
418
|
+
const currentLocale = computed(() => merge(tm("UDatePickerRange"), props.config.i18n));
|
|
419
419
|
|
|
420
420
|
const locale = computed(() => {
|
|
421
421
|
const { months, weekdays } = currentLocale.value;
|
|
@@ -437,16 +437,24 @@ const locale = computed(() => {
|
|
|
437
437
|
const userFormatLocale = computed(() => {
|
|
438
438
|
const { months, weekdays } = currentLocale.value;
|
|
439
439
|
|
|
440
|
+
const monthsLonghand = props.config.i18n?.months?.userFormat
|
|
441
|
+
? months.userFormat
|
|
442
|
+
: months.longhand;
|
|
443
|
+
|
|
444
|
+
const weekdaysLonghand = props.config.i18n?.weekdays?.userFormat
|
|
445
|
+
? weekdays.userFormat
|
|
446
|
+
: weekdays.longhand;
|
|
447
|
+
|
|
440
448
|
// formatted locale
|
|
441
449
|
return {
|
|
442
450
|
...currentLocale,
|
|
443
451
|
months: {
|
|
444
452
|
shorthand: getSortedLocale(months.shorthand, LOCALE_TYPE.month),
|
|
445
|
-
longhand: getSortedLocale(
|
|
453
|
+
longhand: getSortedLocale(monthsLonghand, LOCALE_TYPE.month),
|
|
446
454
|
},
|
|
447
455
|
weekdays: {
|
|
448
456
|
shorthand: getSortedLocale(weekdays.shorthand, LOCALE_TYPE.day),
|
|
449
|
-
longhand: getSortedLocale(
|
|
457
|
+
longhand: getSortedLocale(weekdaysLonghand, LOCALE_TYPE.day),
|
|
450
458
|
},
|
|
451
459
|
};
|
|
452
460
|
});
|