feat: rrule format for x days repeat
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { ref, onBeforeMount, watch } from "vue";
|
||||
import { getCron, parseCron, validCron } from "@/lib/cron";
|
||||
import { getCron, parseCron, validCron } from "@/lib/recurrence";
|
||||
import { CronType } from "@/enums";
|
||||
|
||||
const DEFAULT_CRON = "0 0 * * *";
|
||||
@@ -70,12 +70,21 @@ watch(cron, () => {
|
||||
<option :value="CronType.EVERY_DAY">
|
||||
{{ $t("cron.type.every_day") }}
|
||||
</option>
|
||||
<option :value="CronType.EVERY_N_DAYS">
|
||||
{{ $t("cron.type.every_n_days") }}
|
||||
</option>
|
||||
<option :value="CronType.EVERY_WEEK">
|
||||
{{ $t("cron.type.every_week") }}
|
||||
</option>
|
||||
<option :value="CronType.EVERY_N_WEEKS">
|
||||
{{ $t("cron.type.every_n_weeks") }}
|
||||
</option>
|
||||
<option :value="CronType.EVERY_MONTH">
|
||||
{{ $t("cron.type.every_month") }}
|
||||
</option>
|
||||
<option :value="CronType.EVERY_N_MONTHS">
|
||||
{{ $t("cron.type.every_n_months") }}
|
||||
</option>
|
||||
<option :value="CronType.EVERY_YEAR">
|
||||
{{ $t("cron.type.every_year") }}
|
||||
</option>
|
||||
@@ -159,5 +168,14 @@ watch(cron, () => {
|
||||
:class="valid ? '' : 'input-error'"
|
||||
@input="onInputRawCron"
|
||||
/>
|
||||
<input
|
||||
v-if="cronType === CronType.EVERY_N_DAYS || cronType === CronType.EVERY_N_WEEKS || cronType === CronType.EVERY_N_MONTHS"
|
||||
v-model="cronValue"
|
||||
type="number"
|
||||
min="1"
|
||||
step="1"
|
||||
class="input font-mono flex-1"
|
||||
@input="onChangeCronValue"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -17,7 +17,7 @@ import { isTemporary, taskCompleted, taskNextReset } from "@/lib/tasks";
|
||||
import { relativeTime } from "@/lib/dates";
|
||||
import { useAlertStore } from "@/stores/alerts";
|
||||
import { useI18n } from "vue-i18n";
|
||||
import { isOneTime } from "@/lib/cron";
|
||||
import { isOneTime } from "@/lib/recurrence";
|
||||
|
||||
const emit =
|
||||
defineEmits<(e: "clone" | "delete" | "updated", task: Task) => void>();
|
||||
|
||||
Reference in New Issue
Block a user