package com.smppw.common.rollrange.date.item;


import com.smppw.common.rollrange.date.IDateTime;

import java.util.Calendar;

/**
 * @author Yu Liu
 *
 */
public abstract class BaseDateTime implements IDateTime {
	@Override
	public Calendar endDayOfPeriod(Calendar date) {
		//shift to next period.
		date = shift(date, 1);
		//shift to the first day of that period.
		date = startDayOfPeriod(date);
		//move one day backward, then we reach the end of the previous period.
		date.add(Calendar.DAY_OF_YEAR, -1);
		return date;
	}

}
