How to use the d3-time-format.timeDay function in d3-time-format

To help you get started, we’ve selected a few d3-time-format 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 appnexus / lucid / src / util / chart-helpers.js View on Github external
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);
}