Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function multiFormat(date) {
return (d3TimeFormat.timeSecond(date) < date ? formatMillisecond
: d3TimeFormat.timeMinute(date) < date ? formatSecond
: d3TimeFormat.timeHour(date) < date ? formatMinute
: d3TimeFormat.timeDay(date) < date ? formatHour
: d3TimeFormat.timeMonth(date) < date ? (d3TimeFormat.timeWeek(date) < date ? formatDay : formatWeek)
: d3TimeFormat.timeYear(date) < date ? formatMonth
: formatYear)(date);
}