How to use the utility.formatSeconds function in utility

To help you get started, we’ve selected a few utility examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github odota / web / src / components / Match / Overview / Timeline.jsx View on Github external
<span>
                                  {death.gold_delta &gt; 0 ? <span> : <span>}
                                  {/* nothing if === 0 */}
                                  <font style="{{">{Math.abs(death.gold_delta)} </font>
                                  <img src="{`${process.env.REACT_APP_API_HOST}/apps/dota2/images/tooltips/gold.png`}" alt="">
                                </span>
                              
                            ))}
                          
                        }
                      
                      <time>
                        {obj.type !== 'teamfight' &amp;&amp; formatSeconds(obj.time)}
                      </time>
                    
                  );
                })
              }</span></span>
github odota / web / src / components / Match / matchColumns.jsx View on Github external
const firstPurchase = row.first_purchase_time &amp;&amp; row.first_purchase_time[itemKey];

      if (items[itemKey]) {
        itemArray.push(
          inflictorWithValue(itemKey, formatSeconds(firstPurchase)),
        );
      }

      // Use hero_id because Meepo showing up as an additional unit in some matches http://dev.dota2.com/showthread.php?t=132401
      if (row.hero_id === 80 &amp;&amp; row.additional_units) {
        const additionalItemKey = itemIds[row.additional_units[0][`item_${i}`]];
        const additionalFirstPurchase = row.first_purchase_time &amp;&amp; row.first_purchase_time[additionalItemKey];

        if (items[additionalItemKey]) {
          additionalItemArray.push(
            inflictorWithValue(additionalItemKey, formatSeconds(additionalFirstPurchase)),
          );
        }
      }
    }
    return (
      <div>
        {itemArray &amp;&amp; <div>{itemArray}</div>}
        {additionalItemArray &amp;&amp; <div>{additionalItemArray}</div>}
      </div>
    );
  },
}, {
github odota / web / src / components / Match / Overview / Timeline.jsx View on Github external
}
            
          
          <time>{formatSeconds(match.duration)}</time>
        
        <div>
          {fTower &amp;&amp;
            <div>
              <span>{strings.match_first_tower} </span>
              {formatSeconds(fTower)}
            </div>
          }
          {fRax &amp;&amp;
            <div>
              <span>{strings.match_first_barracks} ({strings[`barracks_value_${fRax.key}`]}) </span>
              {formatSeconds(fRax.time)}
            </div>
          }
        </div>
      
    );
  }

  return null;
};
github odota / web / src / components / Records / index.jsx View on Github external
  displayFn: (row, col, _field) => (row.hero_id === '' ? formatSeconds(_field) : Number(_field).toLocaleString()),
}, {
github odota / web / src / components / Match / MatchLog.jsx View on Github external
  displayFn: (row, col, field) => formatSeconds(field),
}, {
github odota / web / src / components / Match / Vision / WardLog.jsx View on Github external
const rowStyle = { ...style,
    backgroundColor: log.key % 2 === 0 ? styles.wardLogRowEvenSurfaceColor : styles.wardLogRowOddSurfaceColor,
  };

  return (
    <li>
      
        
          <img role="presentation" src="{`${API_HOST}/apps/dota2/images/items/ward_${log.type}_lg.png`}" height="29">
        
        
          {heroTd(match.players[log.player])}
        
        {formatSeconds(log.entered.time)}
        {formatSeconds(log.left &amp;&amp; log.left.time) || '-'}
        {formatSeconds(duration)}
        {wardKiller}
      
    </li>
  );
};
github odota / web / src / components / Match / matchColumns.jsx View on Github external
.map((purchase) =&gt; {
          if (items[purchase.key]) {
            return inflictorWithValue(purchase.key, formatSeconds(purchase.time));
          }
          return <span>;
        }) : ''}
      ),</span>
github odota / web / src / components / Match / MatchStory.jsx View on Github external
format() {
    return formatTemplate(strings.story_item_purchase, {
      time: formatSeconds(this.time),
      player: PlayerSpan(this.player),
      item: ItemSpan(this.item),
    });
  }
}
github odota / web / src / components / Match / MatchStory.jsx View on Github external
format() {
    return formatTemplate(strings.story_expensive_item, {
      time: formatSeconds(this.time),
      player: PlayerSpan(this.player),
      item: ItemSpan(this.item),
      price_limit: GoldSpan(this.price_limit),
    });
  }
}