forked from verdnatura/salix-front
Improve getLocales code
This commit is contained in:
parent
6bb0d30284
commit
772959ff81
|
@ -43,12 +43,15 @@ export const useWeekdayStore = defineStore('weekdayStore', () => {
|
||||||
const getLocales = computed(() => {
|
const getLocales = computed(() => {
|
||||||
// El día de mañana esto permitirá ordenar los weekdays en base a el locale si se lo desea reemplazando localeOrder.es por localeOrder[locale]
|
// El día de mañana esto permitirá ordenar los weekdays en base a el locale si se lo desea reemplazando localeOrder.es por localeOrder[locale]
|
||||||
const locales = [];
|
const locales = [];
|
||||||
|
|
||||||
for (let code of localeOrder.es) {
|
for (let code of localeOrder.es) {
|
||||||
|
const weekDay = weekdaysMap[code];
|
||||||
|
const locale = t(`weekdays.${weekdaysMap[code].code}`);
|
||||||
const obj = {
|
const obj = {
|
||||||
...weekdaysMap[code],
|
...weekDay,
|
||||||
locale: t(`weekdays.${weekdaysMap[code].code}`),
|
locale,
|
||||||
localeChar: t(`weekdays.${weekdaysMap[code].code}`).substr(0, 1),
|
localeChar: locale.substr(0, 1),
|
||||||
localeAbr: t(`weekdays.${weekdaysMap[code].code}`).substr(0, 3),
|
localeAbr: locale.substr(0, 3),
|
||||||
};
|
};
|
||||||
locales.push(obj);
|
locales.push(obj);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue