本文整理汇总了TypeScript中helpers/time_formatter.formatInDate函数的典型用法代码示例。如果您正苦于以下问题:TypeScript formatInDate函数的具体用法?TypeScript formatInDate怎么用?TypeScript formatInDate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了formatInDate函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("should deserialize to svn material", () => {
const materialJSON = TestData.svn();
const attributesJSON = materialJSON.attributes as ScmAttributesJSON;
const material = Material.fromJSON(materialJSON);
const materialAttributes = material.attributes() as ScmMaterialAttributes;
expect(material.type()).toEqual("svn");
expect(material.mduStartTime()).toEqual(TimeFormatter.formatInDate(materialJSON.mdu_start_time));
expect(materialAttributes.name()).toEqual(attributesJSON.name);
expect(materialAttributes.url()).toEqual(attributesJSON.url);
expect(materialAttributes.autoUpdate()).toEqual(attributesJSON.auto_update);
expect(materialAttributes.destination()).toEqual(attributesJSON.destination);
expect(materialAttributes.filter().ignore()).toEqual(Filter.fromJSON(attributesJSON.filter).ignore());
expect(materialAttributes.invertFilter()).toEqual(attributesJSON.invert_filter);
});
示例2: fromJSON
static fromJSON(material: MaterialJSON): Material {
return new Material(material.type,
MaterialAttributes.fromJSON(material),
TimeFormatter.formatInDate(material.mdu_start_time));
}
示例3: it
it('should deserialize updated on time into date format', () => {
const settings = DataSharingSettings.fromJSON(dataSharingSettingsJSON, {getResponseHeader: () => 'ETag'});
expect(settings.updatedOn()).toBe(TimeFormatter.formatInDate(dataSharingSettingsJSON._embedded.updated_on));
});