fix(task): remove wrong repeat types
Repeating "monthly" or "yearly" was never what people expected, only 30 or 365 days which is not always correct. This change removes these settings since the repeating modes will be re-done anyway. Related to https://kolaente.dev/vikunja/frontend/issues/3585#issuecomment-53642
This commit is contained in:
parent
b187e8c1b6
commit
7746d39161
@ -7,8 +7,8 @@
|
|||||||
<x-button variant="secondary" class="is-small" @click="() => setRepeatAfter(1, 'weeks')">
|
<x-button variant="secondary" class="is-small" @click="() => setRepeatAfter(1, 'weeks')">
|
||||||
{{ $t('task.repeat.everyWeek') }}
|
{{ $t('task.repeat.everyWeek') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
<x-button variant="secondary" class="is-small" @click="() => setRepeatAfter(1, 'months')">
|
<x-button variant="secondary" class="is-small" @click="() => setRepeatAfter(30, 'days')">
|
||||||
{{ $t('task.repeat.everyMonth') }}
|
{{ $t('task.repeat.every30d') }}
|
||||||
</x-button>
|
</x-button>
|
||||||
</div>
|
</div>
|
||||||
<div class="is-flex is-align-items-center mb-2">
|
<div class="is-flex is-align-items-center mb-2">
|
||||||
@ -51,8 +51,6 @@
|
|||||||
<option value="hours">{{ $t('task.repeat.hours') }}</option>
|
<option value="hours">{{ $t('task.repeat.hours') }}</option>
|
||||||
<option value="days">{{ $t('task.repeat.days') }}</option>
|
<option value="days">{{ $t('task.repeat.days') }}</option>
|
||||||
<option value="weeks">{{ $t('task.repeat.weeks') }}</option>
|
<option value="weeks">{{ $t('task.repeat.weeks') }}</option>
|
||||||
<option value="months">{{ $t('task.repeat.months') }}</option>
|
|
||||||
<option value="years">{{ $t('task.repeat.years') }}</option>
|
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,10 +16,6 @@ export function secondsToPeriod(seconds: number): { unit: PeriodUnit, amount: nu
|
|||||||
if (seconds % SECONDS_A_DAY === 0) {
|
if (seconds % SECONDS_A_DAY === 0) {
|
||||||
if (seconds % SECONDS_A_WEEK === 0) {
|
if (seconds % SECONDS_A_WEEK === 0) {
|
||||||
return {unit: 'weeks', amount: seconds / SECONDS_A_WEEK}
|
return {unit: 'weeks', amount: seconds / SECONDS_A_WEEK}
|
||||||
} else if (seconds % SECONDS_A_MONTH === 0) {
|
|
||||||
return {unit: 'days', amount: seconds / SECONDS_A_MONTH * 30}
|
|
||||||
} else if (seconds % SECONDS_A_YEAR === 0) {
|
|
||||||
return {unit: 'years', amount: seconds / SECONDS_A_YEAR}
|
|
||||||
} else {
|
} else {
|
||||||
return {unit: 'days', amount: seconds / SECONDS_A_DAY}
|
return {unit: 'days', amount: seconds / SECONDS_A_DAY}
|
||||||
}
|
}
|
||||||
|
@ -770,7 +770,7 @@
|
|||||||
"repeat": {
|
"repeat": {
|
||||||
"everyDay": "Every Day",
|
"everyDay": "Every Day",
|
||||||
"everyWeek": "Every Week",
|
"everyWeek": "Every Week",
|
||||||
"everyMonth": "Every Month",
|
"every30d": "Every 30 Days",
|
||||||
"mode": "Repeat mode",
|
"mode": "Repeat mode",
|
||||||
"monthly": "Monthly",
|
"monthly": "Monthly",
|
||||||
"fromCurrentDate": "From Current Date",
|
"fromCurrentDate": "From Current Date",
|
||||||
|
@ -81,12 +81,6 @@ export default class TaskService extends AbstractService<ITask> {
|
|||||||
case 'weeks':
|
case 'weeks':
|
||||||
repeatAfterSeconds = model.repeatAfter.amount * SECONDS_A_WEEK
|
repeatAfterSeconds = model.repeatAfter.amount * SECONDS_A_WEEK
|
||||||
break
|
break
|
||||||
case 'months':
|
|
||||||
repeatAfterSeconds = model.repeatAfter.amount * SECONDS_A_MONTH
|
|
||||||
break
|
|
||||||
case 'years':
|
|
||||||
repeatAfterSeconds = model.repeatAfter.amount * SECONDS_A_YEAR
|
|
||||||
break
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
model.repeatAfter = repeatAfterSeconds
|
model.repeatAfter = repeatAfterSeconds
|
||||||
|
Loading…
x
Reference in New Issue
Block a user