本文整理汇总了TypeScript中moment-timezone.tz.setDefault方法的典型用法代码示例。如果您正苦于以下问题:TypeScript tz.setDefault方法的具体用法?TypeScript tz.setDefault怎么用?TypeScript tz.setDefault使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类moment-timezone.tz
的用法示例。
在下文中一共展示了tz.setDefault方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: beforeEach
beforeEach(() => {
moment.tz.setDefault('UTC');
});
示例2: afterEach
afterEach(() => {
moment.tz.setDefault('Browser');
});
示例3:
import * as Constants from '@js/constants/index'
import * as Cookies from 'js-cookie'
import * as GibsonApi from '@js/api/gibsonApi'
import * as Moment from 'moment-timezone'
// set timezone globally
Moment.tz.setDefault('Asia/Tokyo')
// functions for eventlistener
let eventOffline
let eventOnline
let eventBeforeunloadAlert
let eventBeforeunloadCookie
const state = {
serverTimeOffset: undefined,
isLoading: false,
isOnline: true,
isDev: Constants.isDev,
errorCode: undefined,
constants: Constants
}
const getters = {
isLoading: state => state.isLoading,
isOnline: state => state.isOnline,
isDev: state => state.isDev,
errorCode: state => state.errorCode,
constants: state => state.constants
}
const actions = {