From 6815dbd6844fcae271e9f72d36f93cadc4b87180 Mon Sep 17 00:00:00 2001 From: Faerbit Date: Wed, 1 Dec 2021 00:44:21 +0100 Subject: [PATCH] Always start with current date --- src/fime/report.py | 3 ++- src/fime/worklog.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/fime/report.py b/src/fime/report.py index 006f77e..ea75235 100644 --- a/src/fime/report.py +++ b/src/fime/report.py @@ -5,7 +5,7 @@ try: except ImportError: from PySide2 import QtCore, QtGui, QtWidgets -from datetime import datetime +from datetime import datetime, date from fime.data import Tasks, Report from fime.util import get_screen_height, get_icon, EditStartedDetector @@ -98,6 +98,7 @@ class ReportDialog(QtWidgets.QDialog): self.setLayout(layout) def showEvent(self, _): + self._report.date = date.today() self.update_title() self.refresh_table() self.update_prev_next() diff --git a/src/fime/worklog.py b/src/fime/worklog.py index d25f938..700e4cb 100644 --- a/src/fime/worklog.py +++ b/src/fime/worklog.py @@ -1,3 +1,4 @@ +from datetime import date from functools import reduce, partial from typing import List, Tuple @@ -178,6 +179,7 @@ class WorklogDialog(QtWidgets.QDialog): def showEvent(self, _): # reinitialize to purge caches self.rest = WorklogRest(self.config) + self._worklog.date = date.today() self.update_all() self.upload_button.setEnabled(False)