1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-23 15:29:42 +02:00

fix(edgejobs): validate date when saving job in basic configuration (#7048)

This commit is contained in:
matias-portainer 2022-07-21 16:43:52 -03:00 committed by GitHub
parent 4fb1880ddc
commit 005c48b1ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -59,7 +59,10 @@ export class EdgeJobFormController {
}
if (this.formValues.cronMethod === 'basic') {
if (!this.model.Recurring) {
if (!this.model.Recurring && (this.formValues.datetime === undefined || !this.formValues.datetime.isValid())) {
this.state.formValidationError = 'Schedule date must not be empty';
return;
} else if (!this.model.Recurring) {
this.model.CronExpression = datetimeToCron(this.formValues.datetime);
} else {
this.model.CronExpression = this.formValues.scheduleValue.cron;