add date switch functionality