Trim whitespace before regex for time multiplyier

This commit is contained in:
benjamin melançon 2022-06-10 15:55:43 -04:00
parent ae64de6c21
commit d16f8bed78

View file

@ -112,6 +112,9 @@ timelog.tmp_timeshift = '(' + timelog.tmp_timeshift + ')'
timelog['tmp_timeshift'] = timelog['tmp_timeshift'].fillna("") timelog['tmp_timeshift'] = timelog['tmp_timeshift'].fillna("")
timelog['description'] = timelog.apply(lambda x: x['description'].replace(x['tmp_timeshift'], ''), axis=1) timelog['description'] = timelog.apply(lambda x: x['description'].replace(x['tmp_timeshift'], ''), axis=1)
# Be sure to trim any whitespace before we regex for ending on asterisk number.
timelog['description'] = timelog['description'].str.strip()
# If a multiplier has been provided (an asterisk and an integer at the end of a # If a multiplier has been provided (an asterisk and an integer at the end of a
# task), then multiply the time by it and remove it from the description. # task), then multiply the time by it and remove it from the description.
# Ensure we're splitting on the same asterisk we found: Use the end of string # Ensure we're splitting on the same asterisk we found: Use the end of string