Add 'Last Month' date range for timesheet reports
This commit is contained in:
parent
426142c0c3
commit
df6ea8d139
4 changed files with 10 additions and 0 deletions
|
|
@ -5,6 +5,7 @@
|
|||
* Allow setting a code block on a line that already has text (it will start a newline for the codeblock)
|
||||
* Retain indentation when tab is used to indent a line, unless enter is pressed twice or user deletes the indentation
|
||||
* Add missing strings (for English and French)
|
||||
* Add 'Last Month' date range for timesheet reports
|
||||
|
||||
# 0.7.5
|
||||
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@
|
|||
"date_range": "Date range",
|
||||
"custom_range": "Custom",
|
||||
"last_week": "Last week",
|
||||
"last_month": "Last month",
|
||||
"this_week": "This week",
|
||||
"this_month": "This month",
|
||||
"this_year": "This year",
|
||||
|
|
|
|||
|
|
@ -217,6 +217,7 @@
|
|||
"date_range": "Plage de dates",
|
||||
"custom_range": "Personnalisé",
|
||||
"last_week": "La semaine dernière",
|
||||
"last_month": "Le mois dernier",
|
||||
"this_week": "Cette semaine",
|
||||
"this_month": "Ce mois-ci",
|
||||
"this_year": "Cette année",
|
||||
|
|
|
|||
|
|
@ -1055,6 +1055,7 @@ class TimeReportDialog(QDialog):
|
|||
self.range_preset.addItem(strings._("today"), "today")
|
||||
self.range_preset.addItem(strings._("last_week"), "last_week")
|
||||
self.range_preset.addItem(strings._("this_week"), "this_week")
|
||||
self.range_preset.addItem(strings._("last_month"), "last_month")
|
||||
self.range_preset.addItem(strings._("this_month"), "this_month")
|
||||
self.range_preset.addItem(strings._("this_year"), "this_year")
|
||||
self.range_preset.currentIndexChanged.connect(self._on_range_preset_changed)
|
||||
|
|
@ -1214,6 +1215,12 @@ class TimeReportDialog(QDialog):
|
|||
start = start_of_this_week.addDays(-7) # last week's Monday
|
||||
end = start_of_this_week.addDays(-1) # last week's Sunday
|
||||
|
||||
elif preset == "last_month":
|
||||
# Previous calendar month (full month)
|
||||
start_of_this_month = QDate(today.year(), today.month(), 1)
|
||||
start = start_of_this_month.addMonths(-1)
|
||||
end = start_of_this_month.addDays(-1)
|
||||
|
||||
elif preset == "this_month":
|
||||
start = QDate(today.year(), today.month(), 1)
|
||||
end = today
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue