Skip to content

Commit

Permalink
Merge pull request #402 from redlink-gmbh/TT-161-Relative-End-before-…
Browse files Browse the repository at this point in the history
…Start-Bug

Tt 161 relative end before start bug
  • Loading branch information
alireza-dhp authored Feb 5, 2024
2 parents 5cfb7bd + 1389552 commit 667ea4d
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 6 deletions.
35 changes: 31 additions & 4 deletions src/components/shared/RelativeScheduler.vue
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
) {
errors.value.push({
label: 'dtstart',
value: t('schedule.relativeSchedule.error.dtstart.addOffset'),
value: t('scheduler.dialog.relativeSchedule.error.dtstart.addOffset'),
});
}
if (
Expand All @@ -160,7 +160,34 @@
) {
errors.value.push({
label: 'dtend',
value: t('schedule.relativeSchedule.error.dtend.addOffset'),
value: t('scheduler.dialog.relativeSchedule.error.dtend.addOffset'),
});
}
if (
returnSchedule.value.dtend.offset?.value &&
returnSchedule.value.dtstart.offset?.value &&
returnSchedule.value.dtstart.offset?.value >
returnSchedule.value.dtend.offset?.value
) {
errors.value.push({
label: 'dtend',
value: t(
'scheduler.dialog.relativeSchedule.error.dtend.EndBeforeStart'
),
});
}
if (
returnSchedule.value.dtstart.time &&
returnSchedule.value.dtend.time &&
returnSchedule.value.dtstart.offset?.value ===
returnSchedule.value.dtend.offset?.value &&
returnSchedule.value.dtstart.time >= returnSchedule.value.dtend.time
) {
errors.value.push({
label: 'dtend',
value: t(
'scheduler.dialog.relativeSchedule.error.dtend.EndBeforeStart'
),
});
}
if (repeatChecked.value) {
Expand All @@ -170,7 +197,7 @@
) {
errors.value.push({
label: 'rrruleFreq',
value: t('schedule.relativeSchedule.error.rrrule.frequency'),
value: t('scheduler.dialog.relativeSchedule.error.rrrule.frequency'),
});
}
if (
Expand All @@ -179,7 +206,7 @@
) {
errors.value.push({
label: 'rrruleEndAfter',
value: t('schedule.relativeSchedule.error.rrrule.endAfter'),
value: t('scheduler.dialog.relativeSchedule.error.rrrule.endAfter'),
});
}
if (frequencyXTimes.value && frequencyXTimes.value <= 0) {
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -941,7 +941,8 @@
"addOffset": "Befülle den Offset des relativen Startzeitraum."
},
"dtend": {
"addOffset": "Befülle den Offset des relativen Endzeitraum."
"addOffset": "Befülle den Offset des relativen Endzeitraum.",
"EndBeforeStart": "Bitte setzen Sie den relativen Startzeitpunkt vor dem Endzeitpunkt"
},
"rrrule": {
"frequency": "Fülle die Widerholungsrate ein.",
Expand Down
3 changes: 2 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -944,7 +944,8 @@
"addOffset": "Fill in the offset of the relative start period."
},
"dtend": {
"addOffset": "Fill in the offset of the relative end period."
"addOffset": "Fill in the offset of the relative end period.",
"EndBeforeStart": "Please Set the relative start period before the end period"
},
"rrrule": {
"frequency": "Fill in the repetition rate.",
Expand Down

0 comments on commit 667ea4d

Please sign in to comment.