Update autodoist.py

Fix error when day only has one digit and add debug logging
pull/26/head
Alexander Holzapfel 2022-08-04 00:31:56 +02:00 committed by GitHub
parent 67935a5b0c
commit a96b2051fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -521,11 +521,15 @@ def run_recurring_lists_logic(args, api, item, child_items, child_items_all, reg
if len(today_str[1]) == 1:
today_str[1] = ''.join(
['0', today_str[1]])
if len(today_str[2]) == 1:
today_str[2] = ''.join(
['0', today_str[2]])
# Update due-date to today
item_due = item['due']
item_due['date'] = '-'.join(
today_str)
logging.debug('Setting task due to: %s' % (item_due))
item.update(due=item_due)
# item.update(due={'date': '2020-05-29', 'is_recurring': True, 'string': 'every day'})