本文整理匯總了TypeScript中@angular/facade.DateWrapper類的典型用法代碼示例。如果您正苦於以下問題:TypeScript DateWrapper類的具體用法?TypeScript DateWrapper怎麽用?TypeScript DateWrapper使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了DateWrapper類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: toJson
toJson() {
return {
'timeStamp': DateWrapper.toJson(this.timeStamp),
'runIndex': this.runIndex,
'values': this.values
};
}
示例2: it
it('should reportSample to call', inject([AsyncTestCompleter], (async) => {
var completeSample = [
new MeasureValues(0, DateWrapper.now(), {}),
new MeasureValues(1, DateWrapper.now(), {})
];
var validSample = [completeSample[1]];
createReporters(['m1', 'm2'])
.then((r) => r.reportSample(completeSample, validSample))
.then((values) => {
expect(values).toEqual([
{'id': 'm1', 'completeSample': completeSample, 'validSample': validSample},
{'id': 'm2', 'completeSample': completeSample, 'validSample': validSample}
]);
async.done();
})
}));
示例3: reportSample
reportSample(completeSample: MeasureValues[], validSample: MeasureValues[]): Promise<any> {
var content = Json.stringify({
'description': this._description,
'completeSample': completeSample,
'validSample': validSample
});
var filePath =
`${this._path}/${this._description.id}_${DateWrapper.toMillis(this._now())}.json`;
return this._writeFile(filePath, content);
}
示例4: mv
function mv(runIndex, time, values) {
return new MeasureValues(runIndex, DateWrapper.fromMillis(time), values);
}
示例5: bind
bind(Options.NOW).toValue(() => DateWrapper.fromMillis(1234)),
示例6:
{provide: _NOW, useValue: () => DateWrapper.now()},
示例7: provide
provide(_NOW, {useValue: () => DateWrapper.now()}),