mirror of
https://github.com/grocy/grocy.git
synced 2025-04-29 01:32:38 +00:00
Added a chore period type "yearly" (closes #407)
This commit is contained in:
parent
28b23fd313
commit
ba6bfa6a2c
@ -5,7 +5,8 @@
|
|||||||
- Fixed that recipes were displayed without ingredients if the total recipe count was > 100
|
- Fixed that recipes were displayed without ingredients if the total recipe count was > 100
|
||||||
|
|
||||||
### Chores improvements
|
### Chores improvements
|
||||||
- Added a "period interval" option per chore to have more flexible schedules (possible for the daily/weekly/monthly schedules, means "schedule this chore only every x days/weeks/months" to have for example biweekly schedules)
|
- Added a new period type "yearly" (for yearly schedules)
|
||||||
|
- Added a "period interval" option per chore to have more flexible schedules (possible for the daily/weekly/monthly/yearly schedules, means "schedule this chore only every x days/weeks/months" to have for example biweekly schedules)
|
||||||
|
|
||||||
### General & other improvements
|
### General & other improvements
|
||||||
- New Input shorthands for date fields to increase/decrease the date by 1 month/year (shift + arrow keys, see the full list [here](https://github.com/grocy/grocy#input-shorthands-for-date-fields))
|
- New Input shorthands for date fields to increase/decrease the date by 1 month/year (shift + arrow keys, see the full list [here](https://github.com/grocy/grocy#input-shorthands-for-date-fields))
|
||||||
|
@ -26,3 +26,6 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "monthly"
|
msgid "monthly"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "yearly"
|
||||||
|
msgstr ""
|
||||||
|
@ -1558,3 +1558,9 @@ msgstr ""
|
|||||||
|
|
||||||
msgid "This means the next execution of this chore should only be scheduled every %s months"
|
msgid "This means the next execution of this chore should only be scheduled every %s months"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "This means the next execution of this chore is scheduled 1 year after the last execution"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
|
msgid "This means the next execution of this chore should only be scheduled every %s years"
|
||||||
|
msgstr ""
|
||||||
|
@ -34,6 +34,7 @@ SELECT
|
|||||||
WHEN period_config LIKE '%saturday%' THEN DATETIME(IFNULL(MAX(l.tracked_time), DATETIME('now', 'localtime')), '1 days', '+' || CAST((h.period_interval - 1) * 7 AS TEXT) || ' days', 'weekday 6')
|
WHEN period_config LIKE '%saturday%' THEN DATETIME(IFNULL(MAX(l.tracked_time), DATETIME('now', 'localtime')), '1 days', '+' || CAST((h.period_interval - 1) * 7 AS TEXT) || ' days', 'weekday 6')
|
||||||
END
|
END
|
||||||
WHEN 'monthly' THEN DATETIME(IFNULL(MAX(l.tracked_time), DATETIME('now', 'localtime')), '+' || CAST(h.period_interval AS TEXT) || ' month', 'start of month', '+' || CAST(h.period_days - 1 AS TEXT) || ' day')
|
WHEN 'monthly' THEN DATETIME(IFNULL(MAX(l.tracked_time), DATETIME('now', 'localtime')), '+' || CAST(h.period_interval AS TEXT) || ' month', 'start of month', '+' || CAST(h.period_days - 1 AS TEXT) || ' day')
|
||||||
|
WHEN 'yearly' THEN DATETIME(IFNULL(MAX(l.tracked_time), DATETIME('now', 'localtime')), '+' || CAST(h.period_interval AS TEXT) || ' years')
|
||||||
END AS next_estimated_execution_time,
|
END AS next_estimated_execution_time,
|
||||||
h.track_date_only,
|
h.track_date_only,
|
||||||
h.rollover,
|
h.rollover,
|
||||||
|
@ -157,6 +157,11 @@ $('.input-group-chore-period-type').on('change', function(e)
|
|||||||
$("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", "31"));
|
$("#period_days").parent().find(".invalid-feedback").text(__t('The amount must be between %1$s and %2$s', "1", "31"));
|
||||||
$('#chore-period-interval-info').text(__t('This means the next execution of this chore should only be scheduled every %s months', periodInterval.toString()));
|
$('#chore-period-interval-info').text(__t('This means the next execution of this chore should only be scheduled every %s months', periodInterval.toString()));
|
||||||
}
|
}
|
||||||
|
else if (periodType === 'yearly')
|
||||||
|
{
|
||||||
|
$('#chore-period-type-info').text(__t('This means the next execution of this chore is scheduled 1 year after the last execution'));
|
||||||
|
$('#chore-period-interval-info').text(__t('This means the next execution of this chore should only be scheduled every %s years', periodInterval.toString()));
|
||||||
|
}
|
||||||
|
|
||||||
Grocy.FrontendHelpers.ValidateForm('chore-form');
|
Grocy.FrontendHelpers.ValidateForm('chore-form');
|
||||||
});
|
});
|
||||||
|
@ -11,6 +11,7 @@ class ChoresService extends BaseService
|
|||||||
const CHORE_PERIOD_TYPE_DAILY = 'daily';
|
const CHORE_PERIOD_TYPE_DAILY = 'daily';
|
||||||
const CHORE_PERIOD_TYPE_WEEKLY = 'weekly';
|
const CHORE_PERIOD_TYPE_WEEKLY = 'weekly';
|
||||||
const CHORE_PERIOD_TYPE_MONTHLY = 'monthly';
|
const CHORE_PERIOD_TYPE_MONTHLY = 'monthly';
|
||||||
|
const CHORE_PERIOD_TYPE_YEARLY = 'yearly';
|
||||||
|
|
||||||
const CHORE_ASSIGNMENT_TYPE_NO_ASSIGNMENT = 'no-assignment';
|
const CHORE_ASSIGNMENT_TYPE_NO_ASSIGNMENT = 'no-assignment';
|
||||||
const CHORE_ASSIGNMENT_TYPE_WHO_LEAST_DID_FIRST = 'who-least-did-first';
|
const CHORE_ASSIGNMENT_TYPE_WHO_LEAST_DID_FIRST = 'who-least-did-first';
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
'min' => '1',
|
'min' => '1',
|
||||||
'additionalCssClasses' => 'input-group-chore-period-type',
|
'additionalCssClasses' => 'input-group-chore-period-type',
|
||||||
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
'invalidFeedback' => $__t('This cannot be lower than %s', '1'),
|
||||||
'additionalGroupCssClasses' => 'period-type-input period-type-daily period-type-weekly period-type-monthly',
|
'additionalGroupCssClasses' => 'period-type-input period-type-daily period-type-weekly period-type-monthly period-type-yearly',
|
||||||
'hintId' => 'chore-period-interval-info'
|
'hintId' => 'chore-period-interval-info'
|
||||||
))
|
))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user