本文整理汇总了TypeScript中moment.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: expect
state.take(1).subscribe((s) => {
expect(moment(u).isSame(s.items.lastUpdate)).toBeTruthy();
});
示例2:
ctx.options.grid.markings.forEach((m, i) => {
console.log(
`Marking (${i}): from=${moment(m.xaxis.from).format()}, to=${moment(m.xaxis.to).format()}, color=${m.color}`
);
});
示例3: it
it('should work', () => {
expect(startViewDate(viewCells))
.toEqual(moment('2018-06-10').toDate());
});
示例4: it
it('should add one fill between sunday 23:00 and monday 01:40', () => {
const markings = ctx.options.grid.markings;
expect(moment(markings[0].xaxis.from).format()).toBe(moment('2018-12-10T00:00:00+01:00').format());
expect(moment(markings[0].xaxis.to).format()).toBe(moment('2018-12-10T02:40:00+01:00').format());
});
示例5: beforeEach
beforeEach(() => {
builder.rawQueryString = 'query=Tablename | where myTime >= $__from and myTime <= $__to';
builder.options.range.to = moment().subtract(1, 'hour');
builder.options.rangeRaw.to = 'now-1h';
});
示例6: moment
ctx.timeSrvMock.timeRange = () => {
return {
from: moment(1531468681),
to: moment(1531489712),
};
};
示例7: encodeMoment
import JsonEsc from 'jsonesc';
import moment from 'moment';
const startTime = moment();
const Moment = startTime.constructor;
function encodeMoment(val: any): string {
return `\u001bTime:${val.toISOString(true)}`;
}
function decodeMoment(str: string): any {
return moment.parseZone(str.substr(6));
}
let encoder = new JsonEsc();
encoder.registerRaw('Time', Moment, encodeMoment, decodeMoment);
export function encode(value: any): string {
return encoder.stringifySorted(value, 1);
}
export function decode(str: string): any {
return encoder.parse(str);
}