$toDay = explode('-', (empty($startDate) ? $joinDate : $startDate));
$year = $toDay[0];
$month = $toDay[1];
+ $day = $toDay[2];
if ($membershipTypeDetails['duration_unit'] == 'year') {
);
$startDay = substr($membershipTypeDetails['fixed_period_start_day'], -2);
- $fixedStartDate = date('Y-m-d', mktime(0, 0, 0, $startMonth, $startDay, $year));
+ if (date('Y-m-d', mktime(0, 0, 0, $startMonth, $startDay, $year)) <= date('Y-m-d', mktime(0, 0, 0, $month, $day, $year))) {
+ $fixedStartDate = date('Y-m-d', mktime(0, 0, 0, $startMonth, $startDay, $year));
+ }
+ else {
+ $fixedStartDate = date('Y-m-d', mktime(0, 0, 0, $startMonth, $startDay, $year - 1));
+ }
//get start rollover day
$rolloverMonth = substr($membershipTypeDetails['fixed_period_rollover_day'], 0,
//store original fixed rollover date as per current year.
$actualRolloverDate = $fixedRolloverDate;
- //make sure membership should not start in future.
- if (!empty($startDate)) {
- if ($startDate < $actualStartDate) {
- $actualStartDate = date('Y-m-d', mktime(0, 0, 0, $startMonth, $startDay, $year - 1));
- }
- }
-
//get the fixed end date here.
$dateParts = explode('-', $actualStartDate);
$fixedEndDate = date('Y-m-d', mktime(0, 0, 0,