This commit is contained in:
@@ -148,21 +148,26 @@ Vue.filter("capitalize", function vueFilterCapitalize(value) {
|
||||
});
|
||||
|
||||
//Convert date to offset value and return as short date time based on browser format
|
||||
Vue.filter("shortdatelocalized", function vueFilterShortDateAndTimeLocalized(
|
||||
value
|
||||
) {
|
||||
if (!value) return "";
|
||||
Vue.filter(
|
||||
"shortdateandtimelocalized",
|
||||
function vueFilterShortDateAndTimeLocalized(value) {
|
||||
if (!value) return "";
|
||||
|
||||
var localizedDate = dayjs
|
||||
.utc(value)
|
||||
.add(locale.format().timeZoneOffset, "hour")
|
||||
.toDate();
|
||||
return localizedDate.toLocaleString(undefined, {
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
hour12: locale.format().hour12
|
||||
});
|
||||
});
|
||||
var localizedDate = dayjs
|
||||
.utc(value)
|
||||
.add(locale.format().timeZoneOffset, "hour")
|
||||
.toDate();
|
||||
|
||||
return localizedDate.toLocaleString(
|
||||
window.$gz.locale.getFirstBrowserLanguage(),
|
||||
{
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
hour12: locale.format().hour12
|
||||
}
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
//Convert date to localized value and return as short date format chosen
|
||||
Vue.filter("shortdateonlylocalized", function vueFilterShortDateOnlyLocalized(
|
||||
@@ -170,11 +175,17 @@ Vue.filter("shortdateonlylocalized", function vueFilterShortDateOnlyLocalized(
|
||||
) {
|
||||
//TODO NOT DONE
|
||||
if (!value) return "";
|
||||
|
||||
return dayjs
|
||||
var localizedDate = dayjs
|
||||
.utc(value)
|
||||
.add(locale.format().timeZoneOffset, "hour")
|
||||
.format(locale.format().shortDateAndTime);
|
||||
.toDate();
|
||||
|
||||
return localizedDate.toLocaleDateString(
|
||||
window.$gz.locale.getFirstBrowserLanguage(),
|
||||
{
|
||||
dateStyle: "short"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//Convert date to localized value and return as short date format chosen
|
||||
@@ -185,10 +196,18 @@ Vue.filter("shorttimeonlylocalized", function vueFilterShortTimeOnlyLocalized(
|
||||
if (!value) return "";
|
||||
//new Date().toLocaleString(undefined,{dateStyle:"short",timeStyle:"short",hour12:false})
|
||||
//also toLocaleDateString and toLocaleTimeString well supported use similar options
|
||||
return dayjs
|
||||
var localizedDate = dayjs
|
||||
.utc(value)
|
||||
.add(locale.format().timeZoneOffset, "hour")
|
||||
.format(locale.format().shortDateAndTime);
|
||||
.toDate();
|
||||
|
||||
return localizedDate.toLocaleTimeString(
|
||||
window.$gz.locale.getFirstBrowserLanguage(),
|
||||
{
|
||||
timeStyle: "short",
|
||||
hour12: locale.format().hour12
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
Vue.filter("currency", function vueFilterCurrency(value) {
|
||||
|
||||
Reference in New Issue
Block a user