function passed for date split