This commit is contained in:
2020-02-06 16:35:35 +00:00
parent 3e28b06374
commit 8a899b6792
3 changed files with 27 additions and 52 deletions

View File

@@ -159,7 +159,7 @@ Vue.filter(
.toDate();
return localizedDate.toLocaleString(
window.$gz.locale.getFirstBrowserLanguage(),
window.$gz.locale.getBrowserLanguages(),
{
dateStyle: "short",
timeStyle: "short",
@@ -181,7 +181,7 @@ Vue.filter("shortdateonlylocalized", function vueFilterShortDateOnlyLocalized(
.toDate();
return localizedDate.toLocaleDateString(
window.$gz.locale.getFirstBrowserLanguage(),
window.$gz.locale.getBrowserLanguages(),
{
dateStyle: "short"
}
@@ -202,7 +202,7 @@ Vue.filter("shorttimeonlylocalized", function vueFilterShortTimeOnlyLocalized(
.toDate();
return localizedDate.toLocaleTimeString(
window.$gz.locale.getFirstBrowserLanguage(),
window.$gz.locale.getBrowserLanguages(),
{
timeStyle: "short",
hour12: locale.format().hour12
@@ -211,10 +211,10 @@ Vue.filter("shorttimeonlylocalized", function vueFilterShortTimeOnlyLocalized(
});
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Browser_compatibility
TODO: Need to specify currency from list of standard values and add to locale settings rather than using symbol I guess
//https://www.currency-iso.org/en/home.html
Vue.filter("currency", function vueFilterCurrency(value) {
if (!value) return "";
return value.toLocaleString(window.$gz.locale.getFirstBrowserLanguage(), {
return value.toLocaleString(window.$gz.locale.getBrowserLanguages(), {
style: "currency",
currency: "EUR"
});