[web] Remove SubscriptionFormatters, format subscription dates in the frontend (#36409)

* [web] Remove SubscriptionFormatters, format subscription dates in the frontend

Replace the server-formatted nextPaymentDueAt/nextPaymentDueDate/
trialEndsAtFormatted fields with the raw periodEnd date and format in
the React dashboard (same strings as before, English + UTC). Also
consolidate hand-rolled trial checks onto isInFreeTrial /
SubscriptionHelper.isInTrial.

* [web] Remove the now-unused dateformat dependency

* [web] Address review: payment-dates unit test, UTC dates in acceptance test

Add a dedicated unit test asserting the exact formatted strings from
formatPaymentDate/formatPaymentDateTime, and use explicit UTC timestamps
in the SubscriptionDashboard acceptance fixtures instead of
local-timezone Date constructors.

GitOrigin-RevId: 16ac4f1098b14ef9f1478d22cf39c1357ead7dea
This commit is contained in:
Antoine Clausse
2026-09-17 11:52:44 +00:00
committed by Copybot
parent d0399bd09f
commit ba4f024f34
26 changed files with 149 additions and 203 deletions
-16
View File
@@ -8006,7 +8006,6 @@ __metadata:
"@types/bootstrap": "npm:^5.2.10"
"@types/chai": "npm:^4.3.0"
"@types/chai-as-promised": "npm:^8.0.2"
"@types/dateformat": "npm:^5.0.3"
"@types/diff": "npm:^5.2.3"
"@types/dom-speech-recognition": "npm:^0.0.7"
"@types/events": "npm:^3.0.3"
@@ -8100,7 +8099,6 @@ __metadata:
cypress-multi-reporters: "npm:^2.0.5"
cypress-plugin-tab: "npm:^1.0.5"
d3: "npm:^3.5.16"
dateformat: "npm:1.0.4-1.2.3"
daterangepicker: "npm:2.1.27"
diff: "npm:^5.1.0"
dompurify: "npm:^3.3.2"
@@ -10795,13 +10793,6 @@ __metadata:
languageName: node
linkType: hard
"@types/dateformat@npm:^5.0.3":
version: 5.0.3
resolution: "@types/dateformat@npm:5.0.3"
checksum: 10c0/828452c096b0b6901a64ce1f3a47fb96755f2451a2605b59fb271407526c62020d171aab6946f9268ca5a4d63db7952c32595bf30b49ed54b218414ec6a02261
languageName: node
linkType: hard
"@types/debug@npm:^4.0.0, @types/debug@npm:^4.1.12, @types/debug@npm:^4.1.8":
version: 4.1.13
resolution: "@types/debug@npm:4.1.13"
@@ -16431,13 +16422,6 @@ __metadata:
languageName: node
linkType: hard
"dateformat@npm:1.0.4-1.2.3":
version: 1.0.4-1.2.3
resolution: "dateformat@npm:1.0.4-1.2.3"
checksum: 10c0/290dec607d80e0a7dbc22d0c2ad19db04ef8c50d1969689b4542bca91c7383e99eadfbca3bc38dab7e8d77e987cc017d051744fe7b29a8b0926b2fe7b4a667b2
languageName: node
linkType: hard
"daterangepicker@npm:2.1.27":
version: 2.1.27
resolution: "daterangepicker@npm:2.1.27"