mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
* Use “now” for calculation of the subscription end date instead of plan.dateUpdated * add test to show previously incorrect logic does not affect sub end date.
This commit is contained in:
@@ -452,7 +452,7 @@ api.cancelSubscription = async function cancelSubscription (data) {
|
||||
let remaining = data.nextBill ? moment(data.nextBill).diff(new Date(), 'days', true) : defaultRemainingDays;
|
||||
if (plan.extraMonths < 0) plan.extraMonths = 0;
|
||||
let extraDays = Math.ceil(30.5 * plan.extraMonths);
|
||||
let nowStr = `${now.format('MM')}/${moment(plan.dateUpdated).format('DD')}/${now.format('YYYY')}`;
|
||||
let nowStr = `${now.format('MM')}/${now.format('DD')}/${now.format('YYYY')}`;
|
||||
let nowStrFormat = 'MM/DD/YYYY';
|
||||
|
||||
plan.dateTerminated =
|
||||
|
||||
Reference in New Issue
Block a user