mirror of
https://github.com/grocy/grocy.git
synced 2025-07-18 20:58:18 +00:00
Apply table filters on /tasks load (fixes #2660)
This commit is contained in:
parent
56d8c2f13a
commit
11fdf5929a
@ -36,7 +36,7 @@
|
|||||||
|
|
||||||
### Tasks
|
### Tasks
|
||||||
|
|
||||||
- xxx
|
- Fixed that set table filters were not applied after editing or adding a task
|
||||||
|
|
||||||
### Batteries
|
### Batteries
|
||||||
|
|
||||||
|
@ -299,22 +299,22 @@ RefreshContextualTimeago = function(rootSelector = "#page-content")
|
|||||||
|
|
||||||
if (!element.hasAttr("datetime"))
|
if (!element.hasAttr("datetime"))
|
||||||
{
|
{
|
||||||
element.text("")
|
element.text("");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var timestamp = element.attr("datetime");
|
var timestamp = element.attr("datetime");
|
||||||
|
|
||||||
if (!timestamp || timestamp.length < 10)
|
if (!timestamp || timestamp.length < 10)
|
||||||
{
|
{
|
||||||
element.text("")
|
element.text("");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!moment(timestamp).isValid())
|
if (!moment(timestamp).isValid())
|
||||||
{
|
{
|
||||||
element.text("")
|
element.text("");
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var isNever = timestamp && timestamp.substring(0, 10) == "2999-12-31";
|
var isNever = timestamp && timestamp.substring(0, 10) == "2999-12-31";
|
||||||
|
@ -198,6 +198,8 @@ function RefreshStatistics()
|
|||||||
var todayThreshold = moment().endOf("day");
|
var todayThreshold = moment().endOf("day");
|
||||||
|
|
||||||
result.forEach(element =>
|
result.forEach(element =>
|
||||||
|
{
|
||||||
|
if (element.due_date)
|
||||||
{
|
{
|
||||||
var date = moment(element.due_date + " 23:59:59").endOf("day");
|
var date = moment(element.due_date + " 23:59:59").endOf("day");
|
||||||
|
|
||||||
@ -214,6 +216,7 @@ function RefreshStatistics()
|
|||||||
{
|
{
|
||||||
dueSoonCount++;
|
dueSoonCount++;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
$("#info-due-today-tasks").html('<span class="d-block d-md-none">' + dueTodayCount + ' <i class="fa-solid fa-clock"></i></span><span class="d-none d-md-block">' + __n(dueTodayCount, '%s task is due to be done today', '%s tasks are due to be done today'));
|
$("#info-due-today-tasks").html('<span class="d-block d-md-none">' + dueTodayCount + ' <i class="fa-solid fa-clock"></i></span><span class="d-none d-md-block">' + __n(dueTodayCount, '%s task is due to be done today', '%s tasks are due to be done today'));
|
||||||
@ -228,3 +231,8 @@ function RefreshStatistics()
|
|||||||
}
|
}
|
||||||
|
|
||||||
RefreshStatistics();
|
RefreshStatistics();
|
||||||
|
|
||||||
|
// Apply filters (there are maybe some set when a task was just edited)
|
||||||
|
$("#search").trigger("keyup");
|
||||||
|
$("#status-filter").trigger("change");
|
||||||
|
$("#category-filter").trigger("change");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user