This commit is contained in:
@@ -149,46 +149,6 @@ Vue.filter("capitalize", function vueFilterCapitalize(value) {
|
||||
|
||||
|
||||
|
||||
//Convert date to localized value and return as short date format chosen
|
||||
Vue.filter("shortdateonlylocalized", function vueFilterShortDateOnlyLocalized(
|
||||
value
|
||||
) {
|
||||
//TODO NOT DONE
|
||||
if (!value) return "";
|
||||
var localizedDate = dayjs
|
||||
.utc(value)
|
||||
.add(locale.format().timeZoneOffset, "hour")
|
||||
.toDate();
|
||||
|
||||
return localizedDate.toLocaleDateString(
|
||||
window.$gz.locale.getBrowserLanguages(),
|
||||
{
|
||||
dateStyle: "short"
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//Convert date to localized value and return as short date format chosen
|
||||
Vue.filter("shorttimeonlylocalized", function vueFilterShortTimeOnlyLocalized(
|
||||
value
|
||||
) {
|
||||
//TODO NOT DONE
|
||||
if (!value) return "";
|
||||
//new Date().toLocaleString(undefined,{dateStyle:"short",timeStyle:"short",hour12:false})
|
||||
//also toLocaleDateString and toLocaleTimeString well supported use similar options
|
||||
var localizedDate = dayjs
|
||||
.utc(value)
|
||||
.add(locale.format().timeZoneOffset, "hour")
|
||||
.toDate();
|
||||
|
||||
return localizedDate.toLocaleTimeString(
|
||||
window.$gz.locale.getBrowserLanguages(),
|
||||
{
|
||||
timeStyle: "short",
|
||||
hour12: locale.format().hour12
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
//https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/toLocaleString#Browser_compatibility
|
||||
//https://www.currency-iso.org/en/home.html
|
||||
|
||||
Reference in New Issue
Block a user