This commit is contained in:
@@ -147,43 +147,7 @@ Vue.filter("capitalize", function vueFilterCapitalize(value) {
|
||||
return value.charAt(0).toUpperCase() + value.slice(1);
|
||||
});
|
||||
|
||||
//Convert date to offset value and return as short date time based on browser format
|
||||
Vue.filter(
|
||||
"shortdateandtimelocalized",
|
||||
function vueFilterShortDateAndTimeLocalized(value) {
|
||||
if (!value) return "";
|
||||
|
||||
//parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z")
|
||||
var parsedDate = new Date(value);
|
||||
//parsedDate now contains the correct value
|
||||
//but any attempt to get it back out that isn't a UTC function will automatically convert to local perceived time zone
|
||||
|
||||
// DATE.toLocaleString('en-GB', { timeZone: 'UTC', dateStyle: "short",timeStyle: "short", hour12: false })
|
||||
|
||||
var ret = parsedDate.toLocaleString(
|
||||
window.$gz.locale.getBrowserLanguages(),
|
||||
{
|
||||
timeZone: locale.getTimeZoneName(),
|
||||
dateStyle: "short",
|
||||
timeStyle: "short",
|
||||
hour12: locale.format().hour12
|
||||
}
|
||||
);
|
||||
|
||||
// console.log("value");
|
||||
// console.log(value);
|
||||
// console.log("parsedDate");
|
||||
// console.log(parsedDate);
|
||||
// console.log("tzAdjustedDate");
|
||||
// console.log(tzAdjustedDate);
|
||||
// console.log("presented as:");
|
||||
// console.log(ret);
|
||||
// console.log("-------");
|
||||
//debugger;
|
||||
|
||||
return ret;
|
||||
}
|
||||
);
|
||||
|
||||
//Convert date to localized value and return as short date format chosen
|
||||
Vue.filter("shortdateonlylocalized", function vueFilterShortDateOnlyLocalized(
|
||||
|
||||
Reference in New Issue
Block a user