Made date selector more generic.