blob: 0f96a45f29594943d5dfbc03bf790243828b836b [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;