X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fschema%2Fyup.js;h=501d79e01db8bc0e7db0931f44cede0f643680f9;hb=73c29bf37f10df401d87d14cc26999f88ce77379;hp=cc4e72416b8783427677bc3efbd69224666dadc2;hpb=d748feb96453d74aeffec648d6f5f68d9ef3b520;p=alttp.git diff --git a/resources/js/schema/yup.js b/resources/js/schema/yup.js index cc4e724..501d79e 100644 --- a/resources/js/schema/yup.js +++ b/resources/js/schema/yup.js @@ -6,7 +6,8 @@ yup.addMethod(yup.string, 'time', function (errorMessage) { return this.test('test-time-format', errorMessage, function (value) { const { path, createError } = this; return ( - parseTime(value) || + !value || + !isNaN(parseTime(value)) || createError({ path, message: errorMessage || 'validation.error.time' }) ); }); @@ -19,6 +20,7 @@ yup.setLocale({ }, string: { time: 'validation.error.time', + url: 'validation.error.url', }, });