]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/schema/yup.js
try to respond more appropriately
[alttp.git] / resources / js / schema / yup.js
index cc4e72416b8783427677bc3efbd69224666dadc2..501d79e01db8bc0e7db0931f44cede0f643680f9 100644 (file)
@@ -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',
        },
 });