Fix the month duration, use the interval field type

Created on 24 March 2014, over 11 years ago
Updated 19 August 2025, 4 days ago

Right now we assume that 1 month is 30 days.
We should make this an actual month.
We also need to account for the fact that strtotime("+1 month") can overreach (Jan 31st + 1 month should be Feb 28th).
Luckily there's Interval, which has the field type that we need, and is really small (also already used by Commerce Recurring). It also allows us to configure the overreach behavior (whether Jan 1st + 1 month should be reduced to Feb 28th or go into March).

So we need to add an interval dependency, hoo_requirements() check, a commerce_license_duration_interval field, and an update hook that populates commerce_license_duration_interval based on commerce_license_duration (in a batch), then deletes the old commerce_license_duration field.

πŸ“Œ Task
Status

Closed: outdated

Version

1.0

Component

Code

Created by

πŸ‡·πŸ‡ΈSerbia bojanz

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024