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


TypeScript rangeutil.describeTimeRange函數代碼示例

本文整理匯總了TypeScript中app/core/utils/rangeutil.describeTimeRange函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript describeTimeRange函數的具體用法?TypeScript describeTimeRange怎麽用?TypeScript describeTimeRange使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了describeTimeRange函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: it

 it('Date range with relative to absolute', () => {
   const text = rangeUtil.describeTimeRange({
     from: 'now-7d',
     to: moment([2014, 10, 10, 2, 3, 4]),
   });
   expect(text).toBe('7 days ago to Nov 10, 2014 02:03:04');
 });
開發者ID:ArcticSnowman,項目名稱:grafana,代碼行數:7,代碼來源:rangeutil.test.ts

示例2: it

 it('Date range with absolute to now', () => {
   var text = rangeUtil.describeTimeRange({
     from: moment([2014, 10, 10, 2, 3, 4]),
     to: 'now',
   });
   expect(text).toBe('Nov 10, 2014 02:03:04 to a few seconds ago');
 });
開發者ID:GPegel,項目名稱:grafana,代碼行數:7,代碼來源:rangeutil.jest.ts

示例3: it

 it('Date range with from and to both are either in now-* or now+* format', () => {
   var text = rangeUtil.describeTimeRange({from: 'now-6h', to: 'now+1h'});
   expect(text).to.be('now-6h to now+1h')
 });
開發者ID:Sensetif,項目名稱:grafana,代碼行數:4,代碼來源:rangeutil_specs.ts

示例4: it

 it('Date range with from and to both are in now-* format', () => {
   var text = rangeUtil.describeTimeRange({from: 'now-6h', to: 'now-3h'});
   expect(text).toBe('now-6h to now-3h');
 });
開發者ID:connection-reset,項目名稱:grafana,代碼行數:4,代碼來源:rangeutil.jest.ts


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