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

import java.util.Calendar;

/**
 * @author Yu Liu
 *
 */
public class Year extends BaseDateTime {

	@Override
	public int between(Calendar startDate, Calendar endDate) {
		return endDate.get(Calendar.YEAR) - startDate.get(Calendar.YEAR);
	}

	@Override
	public Calendar shift(Calendar startDate, int offside) {
		startDate.add(Calendar.YEAR, offside);
		return startDate;
	}

	@Override
	public Calendar startDayOfPeriod(Calendar date) {
		date.set(Calendar.MONTH, 0);
		date.set(Calendar.DAY_OF_MONTH, 1);
		return date;
	}

}
