Skip to content

Commit

Permalink
docs: fix custom validator demo [skip ci] (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
anasmi committed Jul 23, 2020
1 parent dfe2b86 commit 47fda48
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions demo/time-picker-advanced-demos.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,9 @@ <h3>Custom Validator</h3>
window.addDemoReadyListener('#time-picker-advanced-demos-custom-validator', function(document) {
class TimePickerWorkingHoursElement extends Vaadin.TimePickerElement {
checkValidity() {
if (!this.value) {
return false;
}
var hour = /^(\d+)/.exec(this.value)[1];
return hour >= 9 && hour < 17;
}
Expand Down

0 comments on commit 47fda48

Please sign in to comment.