當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript time_formatter.formatInDate函數代碼示例

本文整理匯總了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);
  });
開發者ID:Skarlso,項目名稱:gocd,代碼行數:15,代碼來源:material_spec.ts

示例2: fromJSON

 static fromJSON(material: MaterialJSON): Material {
   return new Material(material.type,
                       MaterialAttributes.fromJSON(material),
                       TimeFormatter.formatInDate(material.mdu_start_time));
 }
開發者ID:GaneshSPatil,項目名稱:gocd,代碼行數:5,代碼來源:material.ts

示例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));
  });
開發者ID:GaneshSPatil,項目名稱:gocd,代碼行數:5,代碼來源:data_sharing_settings_spec.ts


注:本文中的helpers/time_formatter.formatInDate函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。