1export function DateTimeMaskValidator(element, elementId) { 2 this.elementId = elementId; 3 this.element = element; 4 this.regex = function () { 5 return /^\d{0,4}$|^\d{4}-0?$|^\d{4}-(?:0?[1-9]|1[012])(?:-(?:0?[1-9]?|[12]\d|3[01])?)?$/; 6 }; 7 this.carret = function () { 8 return [this.element.selectionStart, this.element.selectionEnd]; 9 }; 10 this.isValid = function (currentValue) { 11 var value = this.element.value, 12 selection = this.carret(); 13 14 return value = value.substring(0, selection[0]) + currentValue + value.substring(selection[1]), !!this.regex().test(value); 15 }; 16}
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.