{"action":"created","issue":{"url":"https://api.github.com/repos/jquery-validation/jquery-validation/issues/1988","repository_url":"https://api.github.com/repos/jquery-validation/jquery-validation","labels_url":"https://api.github.com/repos/jquery-validation/jquery-validation/issues/1988/labels{/name}","comments_url":"https://api.github.com/repos/jquery-validation/jquery-validation/issues/1988/comments","events_url":"https://api.github.com/repos/jquery-validation/jquery-validation/issues/1988/events","html_url":"https://github.com/jquery-validation/jquery-validation/issues/1988","id":219389218,"number":1988,"title":"Number validation Time 00:00 to 23:59 over steps 59.","user":{"login":"weedkiller","id":21086190,"avatar_url":"https://avatars3.githubusercontent.com/u/21086190?v=3","gravatar_id":"","url":"https://api.github.com/users/weedkiller","html_url":"https://github.com/weedkiller","followers_url":"https://api.github.com/users/weedkiller/followers","following_url":"https://api.github.com/users/weedkiller/following{/other_user}","gists_url":"https://api.github.com/users/weedkiller/gists{/gist_id}","starred_url":"https://api.github.com/users/weedkiller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weedkiller/subscriptions","organizations_url":"https://api.github.com/users/weedkiller/orgs","repos_url":"https://api.github.com/users/weedkiller/repos","events_url":"https://api.github.com/users/weedkiller/events{/privacy}","received_events_url":"https://api.github.com/users/weedkiller/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2017-04-04T21:26:04Z","updated_at":"2017-04-05T23:18:29Z","closed_at":null,"body":"Hi, I setup the textbox validation of type `number` with min and max values, I am unable to create the validation so that the mins do not exceed 59 (since there are 60 mins in an hour).\r\n\r\n- What configuration should I set to ensure the time values get `validated between 00:00 to 23:59`\r\n- Is it possible to allow either `.` decimal or `:` as a separator?\r\n\r\nThanks\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/jquery-validation/jquery-validation/issues/comments/292024552","html_url":"https://github.com/jquery-validation/jquery-validation/issues/1988#issuecomment-292024552","issue_url":"https://api.github.com/repos/jquery-validation/jquery-validation/issues/1988","id":292024552,"user":{"login":"Arkni","id":6888059,"avatar_url":"https://avatars0.githubusercontent.com/u/6888059?v=3","gravatar_id":"","url":"https://api.github.com/users/Arkni","html_url":"https://github.com/Arkni","followers_url":"https://api.github.com/users/Arkni/followers","following_url":"https://api.github.com/users/Arkni/following{/other_user}","gists_url":"https://api.github.com/users/Arkni/gists{/gist_id}","starred_url":"https://api.github.com/users/Arkni/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Arkni/subscriptions","organizations_url":"https://api.github.com/users/Arkni/orgs","repos_url":"https://api.github.com/users/Arkni/repos","events_url":"https://api.github.com/users/Arkni/events{/privacy}","received_events_url":"https://api.github.com/users/Arkni/received_events","type":"User","site_admin":false},"created_at":"2017-04-05T23:18:29Z","updated_at":"2017-04-05T23:18:29Z","body":"You got me wrong. I wasn't talking about the HTML `time` element. I was referring to the validation method `time` which is part of the `additional methods`. \r\n\r\nIt can be used as follow:\r\n```js\r\n$(\"form_selector\").validate({\r\n  rules: {\r\n    inputName: {\r\n      time: true\r\n    }\r\n  }\r\n})\r\n```\r\n\r\n\r\n> I do NOT want to force the user to enter HH:MM ... I can/want to let user type just the hours as well like a simple number for e.g. 12 or 8\r\n\r\nAs I said you can use the [`normalizer`](https://jqueryvalidation.org/normalizer/) layer to transform your input value, and the resulting value will be then used in validation. Something like this:\r\n```js\r\n$(\"form_selector\").validate({\r\n  rules: {\r\n    inputName: {\r\n      time: true,\r\n      normalizer: function(currentValue) {\r\n        var isSimpleNumber = /^([01]\\d|2[0-3]|[0-9])$/.test(currentValue);\r\n        // Append \":00\" in case the user entered a simple number between 00 and 23\r\n        return isSimpleNumber ? currentValue + \":00\" : currentValue;\r\n      }\r\n    }\r\n  }\r\n})\r\n```"}}
{"actor":{"display_login":"Arkni"}}