本文整理汇总了TypeScript中moment-timezone/builds/moment-timezone-with-data.moment-timezone-with-data函数的典型用法代码示例。如果您正苦于以下问题:TypeScript moment-timezone-with-data函数的具体用法?TypeScript moment-timezone-with-data怎么用?TypeScript moment-timezone-with-data使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了moment-timezone-with-data函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: isDate
return name.reduce((prev, curr, index, arr) => {
let processed = isDate(curr) ?
moment(curr.timestamp).format('YYYY-MM-DD') :
String(curr);
return index === 0 ? processed: `${prev}, ${processed}`;
}, '');
示例2: shouldStartBoxZooming
shouldStartBoxZooming(zoomStarted: any) {
return (
Math.abs(this.scope.mousep1.x - this.scope.mousep2.x) > 10
&& Math.abs(this.scope.mousep1.y - this.scope.mousep2.y) > 10
&& moment() - zoomStarted > QUICK_ZOOM_DEBOUNCE_TIME
);
};
示例3:
this.datepicker[0].addEventListener('keyup', (event) => {
event.preventDefault();
event.stopPropagation();
const dateStr = this.datepicker[0].value;
if (dateStr && dateStr.length >= 8 && moment(dateStr).isValid()) {
this.flatpickr.setDate(dateStr, true, this.flatpickr.config.dateFormat);
}
}, true);
示例4: applyTimezone
export function applyTimezone(timestamp, tz) {
const time = moment(timestamp, 'x');
if (!tz) {
return time;
}
if (tz.startsWith("GMT")) {
time.utcOffset(tz);
} else {
time.tz(tz);
}
return time;
}
示例5: moment
).callsFake((value) => moment(new Date(value)).format(TIME_UNIT_FORMATS.DATETIME.format));