本文整理汇总了TypeScript中angular2/src/facade/lang.DateWrapper类的典型用法代码示例。如果您正苦于以下问题:TypeScript DateWrapper类的具体用法?TypeScript DateWrapper怎么用?TypeScript DateWrapper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DateWrapper类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: beforeEach
beforeEach(() => {
date = DateWrapper.create(2015, 6, 15, 21, 43, 11);
pipe = new DatePipe();
});
示例5: bind
bind(_NOW).toValue(() => DateWrapper.now())
示例6: mv
function mv(runIndex, time, values) {
return new MeasureValues(runIndex, DateWrapper.fromMillis(time), values);
}
示例7: provide
provide(_NOW, {useValue: () => DateWrapper.now()}),
示例8: bind
bind(Options.NOW).toValue(() => DateWrapper.fromMillis(1234)),
示例9: provide
provide(_MICRO_METRICS, {useValue: {}}), provide(_NOW, {useValue: () => DateWrapper.now()}),