File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
components/trustpilot/sources/new-service-reviews Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -66,13 +66,15 @@ export default {
6666 }
6767
6868 // Emit reviews (already parsed by the action)
69- let latestReviewTime = lastReviewTime ;
69+ let latestReviewTime = lastReviewTime ;
7070
71- for ( const review of reviews ) {
72- // Track the latest review time
73- if ( ! latestReviewTime || review . createdAt > latestReviewTime ) {
74- latestReviewTime = review . createdAt ;
75- }
71+ for ( const review of reviews ) {
72+ // Track the latest review time
73+ const reviewTime = new Date ( review . createdAt ) . toISOString ( ) ;
74+ if ( ! latestReviewTime || new Date ( reviewTime ) > new Date ( latestReviewTime ) ) {
75+ latestReviewTime = reviewTime ;
76+ }
77+ }
7678
7779 // Emit the review with unique ID and summary
7880 this . $emit ( review , {
You can’t perform that action at this time.
0 commit comments