MCPcopy Create free account
hub / github.com/microsoft/SandDance / tickFormat

Function tickFormat

docs/tests/v2/es6/js/sanddance.js:108490–108492  ·  view source on GitHub ↗
(date)

Source from the content-addressed store, hash-verified

108488 var tickIntervals = [[second, 1, durationSecond], [second, 5, 5 * durationSecond], [second, 15, 15 * durationSecond], [second, 30, 30 * durationSecond], [minute, 1, durationMinute], [minute, 5, 5 * durationMinute], [minute, 15, 15 * durationMinute], [minute, 30, 30 * durationMinute], [hour, 1, durationHour], [hour, 3, 3 * durationHour], [hour, 6, 6 * durationHour], [hour, 12, 12 * durationHour], [day, 1, durationDay], [day, 2, 2 * durationDay], [week, 1, durationWeek], [month, 1, durationMonth], [month, 3, 3 * durationMonth], [year, 1, durationYear]];
108489
108490 function tickFormat(date) {
108491 return (second(date) < date ? formatMillisecond : minute(date) < date ? formatSecond : hour(date) < date ? formatMinute : day(date) < date ? formatHour : month(date) < date ? week(date) < date ? formatDay : formatWeek : year(date) < date ? formatMonth : formatYear)(date);
108492 }
108493
108494 function tickInterval(interval, start, stop) {
108495 if (interval == null) interval = 10; // If a desired tick count is specified, pick a reasonable tick interval

Callers

nothing calls this directly

Calls 3

variablePrecisionFunction · 0.85
filterFunction · 0.70
weekFunction · 0.50

Tested by

no test coverage detected