Skip to content

Commit

Permalink
Jetpack: fix the 'invalid date' error on new site stats (#39284)
Browse files Browse the repository at this point in the history
Hide the "Best overall day" date until we have something to show instead of displaying "invalid date".
  • Loading branch information
sergeymitr committed Sep 9, 2024
1 parent 0e3716e commit 82cf82a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,11 @@ class DashStatsBottom extends Component {
numberFormat( s.bestDay.count )
) }
</h3>
<p className="jp-at-a-glance__stat-details">
{ '-' === s.bestDay.day ? '-' : dateI18n( this.props.dateFormat, s.bestDay.day ) }
</p>
{ s.bestDay.day && (
<p className="jp-at-a-glance__stat-details">
{ '-' === s.bestDay.day ? '-' : dateI18n( this.props.dateFormat, s.bestDay.day ) }
</p>
) }
</div>
<div className="jp-at-a-glance__stats-summary-alltime-views">
<p className="jp-at-a-glance__stat-details">
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Fix the 'invalid date' error on new site stats.

0 comments on commit 82cf82a

Please sign in to comment.