put compareDate function to cmUtil
update function
update/fix function for use and update tests

fix cam-849