diff --git a/projects/plugins/jetpack/_inc/client/at-a-glance/stats/dash-stats-bottom.jsx b/projects/plugins/jetpack/_inc/client/at-a-glance/stats/dash-stats-bottom.jsx index 5fd5cd947e398..e15b60a92d6b6 100644 --- a/projects/plugins/jetpack/_inc/client/at-a-glance/stats/dash-stats-bottom.jsx +++ b/projects/plugins/jetpack/_inc/client/at-a-glance/stats/dash-stats-bottom.jsx @@ -70,9 +70,11 @@ class DashStatsBottom extends Component { numberFormat( s.bestDay.count ) ) } -

- { '-' === s.bestDay.day ? '-' : dateI18n( this.props.dateFormat, s.bestDay.day ) } -

+ { s.bestDay.day && ( +

+ { '-' === s.bestDay.day ? '-' : dateI18n( this.props.dateFormat, s.bestDay.day ) } +

+ ) }

diff --git a/projects/plugins/jetpack/changelog/fix-stats-best-day-new-site b/projects/plugins/jetpack/changelog/fix-stats-best-day-new-site new file mode 100644 index 0000000000000..bf8fbd73c5958 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-stats-best-day-new-site @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Fix the 'invalid date' error on new site stats.