This commit is contained in:
@@ -75,6 +75,41 @@ export default {
|
||||
getHour12() {
|
||||
return window.$gz.store.state.userOptions.hour12;
|
||||
},
|
||||
//////////////////////////////////////////////////
|
||||
// Get the user's chosen / auto time zone offset
|
||||
//
|
||||
getTZOffset(timeZoneName) {
|
||||
if (!timeZoneName) {
|
||||
timeZoneName = this.getResolvedTimeZoneName();
|
||||
}
|
||||
let dtNow = window.$gz.DateTime.local();
|
||||
var rezoned = dtNow.setZone(timeZoneName);
|
||||
return rezoned.offset;
|
||||
},
|
||||
// ///////////////////////////////////////////
|
||||
// // Convert timestamp utc epoch value
|
||||
// // to local timestamp epoch value
|
||||
// //
|
||||
// utcEpochToLocalEpoch(value, timeZoneName) {
|
||||
// if (!value) {
|
||||
// return null;
|
||||
// }
|
||||
// if (!timeZoneName) {
|
||||
// timeZoneName = this.getResolvedTimeZoneName();
|
||||
// }
|
||||
|
||||
// let parsedDate = new Date(value);
|
||||
|
||||
// //is it a valid date?
|
||||
// if (!(parsedDate instanceof Date && !isNaN(parsedDate))) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
// return parsedDate.toLocaleDateString(languageName, {
|
||||
// timeZone: timeZoneName,
|
||||
// dateStyle: "short"
|
||||
// });
|
||||
// },
|
||||
///////////////////////////////////////////
|
||||
// Turn a utc date into a displayable
|
||||
// short date and time
|
||||
|
||||
Reference in New Issue
Block a user