src/charts/tooltip.js
function formatDate(date) {
            let settings = dateFormat || defaultAxisSettings;
            let format = null;
            let localeOptions = {month:'short', day:'numeric'};

            if (settings === axisTimeCombinations.DAY_MONTH || settings === axisTimeCombinations.MONTH_YEAR) {
                format = monthDayYearFormat;
                localeOptions.year = 'numeric';
            } else if (settings === axisTimeCombinations.HOUR_DAY || settings === axisTimeCombinations.MINUTE_HOUR) {
                format = monthDayHourFormat;
                localeOptions.hour = 'numeric';
            } else if (settings === axisTimeCombinations.CUSTOM && typeof dateCustomFormat === 'string') {
                format = d3TimeFormat.timeFormat(dateCustomFormat);
            }

            if (locale && ((typeof Intl !== 'undefined') && (typeof Intl === 'object' && Intl.DateTimeFormat))) {
                let f = Intl.DateTimeFormat(locale, localeOptions);

                return f.format(date);
            }

            return format(date);
        }
function formatDate(date) {
            let settings = dateFormat || defaultAxisSettings;
            let format = null;
            let localeOptions = {month:'short', day:'numeric'};

            if (settings === axisTimeCombinations.DAY_MONTH || settings === axisTimeCombinations.MONTH_YEAR) {
                format = monthDayYearFormat;
                localeOptions.year = 'numeric';
            } else if (settings === axisTimeCombinations.HOUR_DAY || settings === axisTimeCombinations.MINUTE_HOUR) {
                format = monthDayHourFormat;
                localeOptions.hour = 'numeric';
            } else if (settings === axisTimeCombinations.CUSTOM && typeof dateCustomFormat === 'string') {
                format = d3TimeFormat.timeFormat(dateCustomFormat);
            }

            if (locale && ((typeof Intl !== 'undefined') && (typeof Intl === 'object' && Intl.DateTimeFormat))) {
                let f = Intl.DateTimeFormat(locale, localeOptions);

                return f.format(date);
            }

            return format(date);
        }
function formatDate ( date ) { let settings = dateFormat || defaultAxisSettings ; let format = null ; let localeOptions = { month : 'short' , day : 'numeric' } ; if ( settings === axisTimeCombinations . DAY_MONTH || settings === axisTimeCombinations . MONTH_YEAR ) { format = monthDayYearFormat ; localeOptions . year = 'numeric' ; } else if ( settings === axisTimeCombinations . HOUR_DAY || settings === axisTimeCombinations . MINUTE_HOUR ) { format = monthDayHourFormat ; localeOptions . hour = 'numeric' ; } else if ( settings === axisTimeCombinations . CUSTOM && typeof dateCustomFormat === 'string' ) { format = d3TimeFormat . timeFormat ( dateCustomFormat ) ; } if ( locale && ( ( typeof Intl !== 'undefined' ) && ( typeof Intl === 'object' && Intl . DateTimeFormat ) ) ) { let f = Intl . DateTimeFormat ( locale , localeOptions ) ; return f . format ( date ) ; } return format ( date ) ; }
Figures out which date format to use when showing the date of the current data entry
@param {Date} date   Date object to format
@return {Function}   The proper date formatting function
@private
Figures out which date format to use when showing the date of the current data entry