blob: 6b4141c605a81e7a06a43caf2a3b17d9e2bb90e2 [file] [log] [blame]
import { format } from 'date-fns-tz';
const LocalTimezoneLabelMixin = {
methods: {
localOffset() {
const timezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const shortTz = this.$options.filters.shortTimeZone(new Date());
const pattern = `'${shortTz}' O`;
return format(new Date(), pattern, { timezone }).replace('GMT', 'UTC');
},
},
};
export default LocalTimezoneLabelMixin;