package shop.alien.store.platformmembership;

import java.util.Calendar;
import java.util.Date;

/**
 * 会员周期按自然月累加（与 Calendar.MONTH 行为一致）
 */
public final class PlatformShopMembershipDateUtil {

    private PlatformShopMembershipDateUtil() {
    }

    public static Date addMonths(Date from, int months) {
        if (from == null) {
            return null;
        }
        Calendar c = Calendar.getInstance();
        c.setTime(from);
        c.add(Calendar.MONTH, months);
        return c.getTime();
    }
}
