Add date calculation logic