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