[bugfix] better logic for detecting if night timings should be applicable