ops->jobs timestamp changed resolution from minutes to seconds
This commit is contained in:
@@ -174,7 +174,50 @@ export default {
|
||||
timeStyle: "short",
|
||||
hour12: hour12
|
||||
});
|
||||
}, ///////////////////////////////////////////
|
||||
},
|
||||
///////////////////////////////////////////
|
||||
// Turn a utc date into a displayable
|
||||
// date and time with specific formats
|
||||
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toLocaleString
|
||||
//
|
||||
utcDateToSpecifiedDateAndTimeLocalized(
|
||||
value,
|
||||
timeZoneName,
|
||||
languageName,
|
||||
hour12,
|
||||
dateStyle,
|
||||
timeStyle
|
||||
) {
|
||||
if (!value) {
|
||||
return "";
|
||||
}
|
||||
if (!timeZoneName) {
|
||||
timeZoneName = this.getResolvedTimeZoneName();
|
||||
}
|
||||
if (!languageName) {
|
||||
languageName = this.getResolvedLanguage();
|
||||
}
|
||||
|
||||
if (!hour12) {
|
||||
hour12 = this.getHour12();
|
||||
}
|
||||
|
||||
//parse the date which is identified as utc ("2020-02-06T18:18:49.148011Z")
|
||||
const parsedDate = new Date(value);
|
||||
|
||||
//is it a valid date?
|
||||
if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {
|
||||
return "not valid";
|
||||
}
|
||||
|
||||
return parsedDate.toLocaleString(languageName, {
|
||||
timeZone: timeZoneName,
|
||||
dateStyle: dateStyle,
|
||||
timeStyle: timeStyle,
|
||||
hour12: hour12
|
||||
});
|
||||
},
|
||||
///////////////////////////////////////////
|
||||
// Turn a utc date into a displayable
|
||||
// short date
|
||||
//
|
||||
|
||||
Reference in New Issue
Block a user