date class and fix tests