Skip to content

Commit 05cff57

Browse files
committed
Fix rounding of subscription expiry date description
This was often 1 day off because dateFns (<v2) uses floor rounding for days by default when describing with strict distances. This is usually confusing, and doesn't match the cancellation confirmation prompt or the accounts dashboard (which uses dateFns v2, that defaults to 'round').
1 parent 4afad11 commit 05cff57

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/settings/settings-page.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,8 @@ class SettingsPage extends React.Component<SettingsPageProps> {
205205
<ContentValue>
206206
{
207207
distanceInWordsStrict(new Date(), sub.expiry, {
208-
addSuffix: true
208+
addSuffix: true,
209+
partialMethod: 'round'
209210
})
210211
} ({
211212
format(sub.expiry.toString(), 'Do [of] MMMM YYYY')

0 commit comments

Comments
 (0)