From 3e02270c2d330ff91678540b658980a5ec790912 Mon Sep 17 00:00:00 2001 From: Chris McCluskey Date: Fri, 12 Apr 2024 11:23:52 -0700 Subject: [PATCH] Fix/memberships/subscription end date format (#36838) * Memberships: use full date for abbreviated subscriptions * changelog --- .../changelog/fix-memberships-subscription-end-date-format | 4 ++++ .../class-wpcom-online-subscription-service.php | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 projects/plugins/jetpack/changelog/fix-memberships-subscription-end-date-format diff --git a/projects/plugins/jetpack/changelog/fix-memberships-subscription-end-date-format b/projects/plugins/jetpack/changelog/fix-memberships-subscription-end-date-format new file mode 100644 index 0000000000000..414490d371486 --- /dev/null +++ b/projects/plugins/jetpack/changelog/fix-memberships-subscription-end-date-format @@ -0,0 +1,4 @@ +Significance: patch +Type: other + +Make the representation of the end date consistent in membership subscription abbreviation. diff --git a/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-wpcom-online-subscription-service.php b/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-wpcom-online-subscription-service.php index 55f43fb8b4de1..6b56daf0b0d3c 100644 --- a/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-wpcom-online-subscription-service.php +++ b/projects/plugins/jetpack/extensions/blocks/premium-content/_inc/subscription-service/class-wpcom-online-subscription-service.php @@ -150,7 +150,7 @@ public static function abbreviate_subscriptions( $subscriptions_from_bd ) { ) ) { $subscriptions[ $subscription['product_id'] ] = new \stdClass(); - $subscriptions[ $subscription['product_id'] ]->end_date = empty( $subscription['end_date'] ) ? ( time() + 365 * 24 * 3600 ) : $subscription['end_date']; + $subscriptions[ $subscription['product_id'] ]->end_date = empty( $subscription['end_date'] ) ? gmdate( 'Y-m-d H:i:s', ( time() + 365 * 24 * 3600 ) ) : $subscription['end_date']; } } return $subscriptions;