本文整理匯總了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));