Fixed a bug in the samEvent function

Added date checking to the sameEvent function