diff --git a/client/my-sites/stats/stats-email-chart-tabs/utility.js b/client/my-sites/stats/stats-email-chart-tabs/utility.js index 1f412444b086d..10f803a89dbf5 100644 --- a/client/my-sites/stats/stats-email-chart-tabs/utility.js +++ b/client/my-sites/stats/stats-email-chart-tabs/utility.js @@ -11,7 +11,7 @@ export function formatDate( date, period ) { const momentizedDate = moment( date ); switch ( period ) { case 'hour': - return momentizedDate.format( 'HH:mm' ); + return momentizedDate.format( 'MMM D' ); case 'day': return momentizedDate.format( 'LL' ); default: @@ -57,10 +57,13 @@ export const buildChartData = memoizeLast( ( activeLegend, chartTab, data, perio function addTooltipData( chartTab, item, period ) { const tooltipData = []; const label = ( () => { + const formattedDate = formatDate( item.data.period, period ); + if ( 'hour' === period ) { - return item.label; + return `${ formattedDate } ${ item.label }`; } - return formatDate( item.data.period, period ); + + return formattedDate; } )(); tooltipData.push( { diff --git a/client/state/stats/lists/utils.js b/client/state/stats/lists/utils.js index 3029f97699b10..0adca161c47ed 100644 --- a/client/state/stats/lists/utils.js +++ b/client/state/stats/lists/utils.js @@ -168,7 +168,7 @@ export function getChartLabels( unit, date, localizedDate ) { const isWeekend = 'day' === unit && ( 6 === dayOfWeek || 0 === dayOfWeek ); const labelName = `label${ unit.charAt( 0 ).toUpperCase() + unit.slice( 1 ) }`; const formats = { - hour: translate( 'MMM D HH:mm', { + hour: translate( 'HH:mm', { context: 'momentjs format string (hour)', comment: 'This specifies an hour for the stats x-axis label.', } ),