MCPcopy Create free account
hub / github.com/apache/echarts / getFirstTimestampOfUnit

Function getFirstTimestampOfUnit

src/scale/Time.ts:447–450  ·  view source on GitHub ↗
(timestamp: number, unitName: TimeUnit, isUTC: boolean)

Source from the content-addressed store, hash-verified

445// e.g., if the input unit is 'day', start calculate ticks from the first day of
446// that month to make ticks "nice".
447function getFirstTimestampOfUnit(timestamp: number, unitName: TimeUnit, isUTC: boolean) {
448 const upperUnitIdx = Math.max(0, indexOf(primaryTimeUnits, unitName) - 1);
449 return roundTime(new Date(timestamp), primaryTimeUnits[upperUnitIdx], isUTC).getTime();
450}
451
452function createEstimateNiceMultiple(
453 setMethodName: JSDateSetterNames,

Callers 1

addLevelTicksFunction · 0.85

Calls 1

roundTimeFunction · 0.90

Tested by

no test coverage detected