]> 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 19f8b5824e1b978a62314f319c1727d5db8db86b..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' })
                );
        });