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