mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 02:02:19 +00:00
Added next due date
This commit is contained in:
parent
1d93943458
commit
a5e0e171cc
3 changed files with 16 additions and 2 deletions
|
|
@ -294,6 +294,7 @@ angular.module('habitrpg')
|
|||
$scope.$watch('task._edit', function (newValue, oldValue) {
|
||||
if ($scope.task.type !== 'daily' || !task._edit) return;
|
||||
$scope.summary = generateSummary($scope.task);
|
||||
$scope.nextDue = generateNextDue($scope.task);
|
||||
|
||||
$scope.repeatSuffix = generateRepeatSuffix($scope.task);
|
||||
if ($scope.task._edit.repeatsOn == 'dayOfMonth') {
|
||||
|
|
@ -385,9 +386,17 @@ angular.module('habitrpg')
|
|||
} else if (task._edit.frequency === 'yearly') {
|
||||
return task._edit.everyX == 1 ? window.env.t('year') : window.env.t('years');
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
function generateNextDue (task) {
|
||||
if (!task.nextDue) return;
|
||||
let nextDue = task.nextDue.map((date) => {
|
||||
let dateObject = new Date(date);
|
||||
return [dateObject.getFullYear(), dateObject.getMonth() + 1, dateObject.getDate()].join('-');
|
||||
})
|
||||
return nextDue.join(', ');
|
||||
}
|
||||
|
||||
function cancelTaskEdit(task) {
|
||||
task._edit = undefined;
|
||||
task._editing = false;
|
||||
|
|
|
|||
|
|
@ -168,5 +168,6 @@
|
|||
"monthlyRepeatHelpContent": "This task will be due every X months",
|
||||
"yearlyRepeatHelpContent": "This task will be due every X years",
|
||||
"resets": "Resets",
|
||||
"summaryStart": "Repeats <%= frequency %> every <%= everyX %> <%= frequencyPlural %> "
|
||||
"summaryStart": "Repeats <%= frequency %> every <%= everyX %> <%= frequencyPlural %> ",
|
||||
"nextDue": "Next Due Dates"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -32,3 +32,7 @@ fieldset.option-group.advanced-option(ng-show="task.type === 'daily'")
|
|||
.form-group
|
||||
legend.option-title=env.t('summary')
|
||||
div {{summary}}
|
||||
|
||||
.form-group(ng-if='nextDue')
|
||||
legend.option-title=env.t('nextDue')
|
||||
div {{nextDue}}
|
||||
|
|
|
|||
Loading…
Reference in a new issue