dateFromCategory tests work. (Added unit tests and modified function accordingly