diff options
| author | Jan Tuomi <jan.tuomi@valuemotive.com> | 2021-02-14 17:51:34 +0200 |
|---|---|---|
| committer | Jan Tuomi <jan.tuomi@valuemotive.com> | 2021-02-14 17:51:34 +0200 |
| commit | 34dc42bca46397118cf4f53e2f119eea1d56cdc1 (patch) | |
| tree | 210dfa562ce16a5bba7ed1ac8b624792ab973acd /hommaexceli_py/data_parser.py | |
| parent | bd2f7811b1f1633e150642222a9e07b5dd7a375a (diff) | |
Fix last done column updatingmaster
Diffstat (limited to 'hommaexceli_py/data_parser.py')
| -rw-r--r-- | hommaexceli_py/data_parser.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hommaexceli_py/data_parser.py b/hommaexceli_py/data_parser.py index f72b05f..7df78ba 100644 --- a/hommaexceli_py/data_parser.py +++ b/hommaexceli_py/data_parser.py @@ -41,7 +41,7 @@ def _process_row(row: SheetsRow): next_date = last_done_date + interval next_date_str = _date_to_timestamp(next_date) else: - last_done_date = datetime.datetime.now() + last_done_date = None next_date = datetime.datetime.now() next_date_str = _date_to_timestamp(next_date) @@ -69,3 +69,9 @@ def _is_this_week(processed_row: ProcessedRow): def filter_only_this_week(rows: list[ProcessedRow]) -> list[ProcessedRow]: return [row for row in rows if _is_this_week(row)] + + +def updated_last_done_datestamps(rows: list[ProcessedRow]) -> list[str]: + return [ + row.next_datestamp if _is_this_week(row) else row.last_datestamp for row in rows + ] |
