Skip to content

Commit 61577a4

Browse files
authored
feat: add option to show/hide due date for chores and tasks (#185)
1 parent b3f2059 commit 61577a4

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ views:
3939
| title | string | **Optional** | `"Todo"` | The title of the card. |
4040
| show_quantity | number | **Optional** | | The number of items you want to show in the card. The rest are either hidden or show in the overflow. |
4141
| show_days | number/range | **Optional** | | If an integer is specified (including `0`), overdue tasks and any occurring in the next `X` days are shown. E.g. `7` displays overdue tasks and any due in the next 7 days, whereas `0` only displays today's tasks and any overdue. If a range is specified, only tasks with a due date within that range are shown. E.g. `1..10` shows tasks due in the next 10 days, but not overdue tasks or tasks due today. If not specified, all items are shown. |
42+
| show_due_date | bool | **Optional** | `true` | Show/hide the due date of chores and tasks. |
4243
| show_chores_without_due | bool | **Optional** | `true` | Show chores that do not have a due date. |
4344
| show_tasks_without_due | bool | **Optional** | `true` | Show tasks that do not have a due date. |
4445
| user_id | number/map | **Optional** | `1` | Id of the Grocy user performing the items. Default if not specified is `1`. A map may also be specified, see [here](#user_id)|

grocy-chores-card.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ class GrocyChoresCard extends LitElement {
377377
}
378378

379379
_shouldRenderDueInDays(item) {
380-
return !this.hide_text_with_no_data || item.__due_date != null;
380+
return this.show_due_date && (!this.hide_text_with_no_data || item.__due_date != null);
381381
}
382382

383383
_renderDueInDays(item) {
@@ -1602,6 +1602,7 @@ class GrocyChoresCard extends LitElement {
16021602
this.show_unassigned = this.config.show_unassigned ?? false;
16031603
this.show_enable_reschedule = this.config.show_enable_reschedule ?? false;
16041604
this.show_skip_next = this.config.show_skip_next ?? false;
1605+
this.show_due_date = this.config.show_due_date ?? true;
16051606
this.show_more_info_popup = this.config.show_more_info_popup ?? false;
16061607
this.disable_show_assign_to_me = this.config.disable_show_assign_to_me ?? false;
16071608
if (this.use_icons) {

0 commit comments

Comments
 (0)