Added functions to handle repeated events and sunrise and sunset events.