With some minor exceptions, I find I rarely want to compare a time period with the period directly before it. This works for years, but for months, I find I would rather compare against the same month in the previous year, etc.
Two dates pickers should be employed to allow the user to select two arbitrary time periods to compare: any two days, any two weeks, any two months, any two years. Maybe even any two series of days of the same length.