[fix] fixed event dispatcher api function to be more flexible in terms of the time
[tests] added tests for time based handlers