Skip to content

Commit

Permalink
Protect: Fix last_checked conversions (#39549)
Browse files Browse the repository at this point in the history
* Convert last_checked value so it in local time before the WP install timezone conversions apply

* changelog

* Update var naming
  • Loading branch information
dkmyta authored Oct 1, 2024
1 parent c9ec079 commit c7b6691
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Fixes lastChecked conversions
5 changes: 4 additions & 1 deletion projects/plugins/protect/src/js/components/summary/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ const Summary = () => {
} = useProtectData();
const { hasPlan } = usePlan();

// Convert the last checked UTC date to a local timestamp
const lastCheckedLocalTimestamp = new Date( lastChecked + ' UTC' ).getTime();

// Popover anchors
const [ dailyScansPopoverAnchor, setDailyScansPopoverAnchor ] = useState( null );

Expand All @@ -38,7 +41,7 @@ const Summary = () => {
{ sprintf(
/* translators: %s: Latest check date */
__( 'Latest results as of %s', 'jetpack-protect' ),
dateI18n( 'F jS', lastChecked )
dateI18n( 'F jS', lastCheckedLocalTimestamp )
) }
</div>
{ ! hasPlan && (
Expand Down

0 comments on commit c7b6691

Please sign in to comment.