handle date type with from and to field