diff --git a/forest/oak/base.py b/forest/oak/base.py index e45b0cdd..03dc4a4a 100644 --- a/forest/oak/base.py +++ b/forest/oak/base.py @@ -473,10 +473,10 @@ def run(study_folder: str, output_folder: str, tz_str: Optional[str] = None, file_list.sort() # transform all files in folder to datelike format - if "+00_00.csv" in file_list[0]: - file_dates = [file.replace("+00_00.csv", "") for file in file_list] - else: - file_dates = [file.replace(".csv", "") for file in file_list] + file_dates = [ + file.replace(".csv", "").replace("+00_00", "") + for file in file_list + ] # process dates dates = [datetime.strptime(file, fmt) for file in file_dates]