<commit_before>class RowFormDateTimeFieldController extends RowFormFieldController {
    constructor(...args) {
        super(...args);
        this.view2 = null;
        this.defaultValue = 0;
        this.state.parseError2 = false;
        this.state.error2 = null;
    }
    getViewClass() {
        return RowFormDateTimeFieldView;
    }
    getValueForView() {
        return this.getValue();
    }
    getValueForTime() {
        const date = this.getValue();
        if (date) {
            const value = date.getHours()*60 + date.getMinutes();
            if (value !== this.defaultValue) return value;
        }
        return null;
    }
    setValueFromView(viewValue) {
        this.setValue(viewValue);
    }
    onView2Create = view2 => {
        // console.log('RowFormDateTimeFieldController.onView2Create', view2);
        this.view2 = view2;
    }
    _onChange(viewValue) {
        // console.log('RowFormDateTimeFieldController._onChange', this.view2);
        if (viewValue !== null) setTimeout(() => {
            const input = this.view2.getInput();
            input.focus();
            input.setSelectionRange(0, input.value.length);
        }, 0);
    }
    onChange2 = (viewValue, fireEvent = true) => {
        // console.log('RowFormDateTimeFieldController.onChange2', viewValue);
        this.resetErrors2();
        try {
            this.setValueFromView2(viewValue);
        } catch (err) {
            console.log(`${this.model.getFullName()}: cannot parse time: ${err.message}`);
            this.state.parseError2 = true;
        }
        /*
        this.validate2();
        if (this.isValid()) {
            this.copyValueToModel();
        }
        */
        this.refreshChanged();
        if (fireEvent) {
            try {
                this.emit('change', {value: viewValue});
            } catch (err) {
                console.error('unhandled change event error:', this.model.getFullName(), err);
            }
            this.parent.onFieldChange({source: this});
        }
    }
    onBlur2 = (viewValue, fireEvent = true) => {
        // console.log('RowFormDateTimeFieldController.onBlur2', viewValue);
        if (!this.isEditable()) return;
        this.validate2();
        if (this.isValid()) {
            this.copyValueToModel();
        }
        this.refreshChanged();
        if (fireEvent) {<commit_msg>onBlur2 no event by default<commit_after>class RowFormDateTimeFieldController extends RowFormFieldController {
    constructor(...args) {
        super(...args);
        this.view2 = null;
        this.defaultValue = 0;
        this.state.parseError2 = false;
        this.state.error2 = null;
    }
    getViewClass() {
        return RowFormDateTimeFieldView;
    }
    getValueForView() {
        return this.getValue();
    }
    getValueForTime() {
        const date = this.getValue();
        if (date) {
            const value = date.getHours()*60 + date.getMinutes();
            if (value !== this.defaultValue) return value;
        }
        return null;
    }
    setValueFromView(viewValue) {
        this.setValue(viewValue);
    }
    onView2Create = view2 => {
        // console.log('RowFormDateTimeFieldController.onView2Create', view2);
        this.view2 = view2;
    }
    _onChange(viewValue) {
        // console.log('RowFormDateTimeFieldController._onChange', this.view2);
        if (viewValue !== null) setTimeout(() => {
            const input = this.view2.getInput();
            input.focus();
            input.setSelectionRange(0, input.value.length);
        }, 0);
    }
    onChange2 = (viewValue, fireEvent = true) => {
        // console.log('RowFormDateTimeFieldController.onChange2', viewValue);
        this.resetErrors2();
        try {
            this.setValueFromView2(viewValue);
        } catch (err) {
            console.log(`${this.model.getFullName()}: cannot parse time: ${err.message}`);
            this.state.parseError2 = true;
        }
        /*
        this.validate2();
        if (this.isValid()) {
            this.copyValueToModel();
        }
        */
        this.refreshChanged();
        if (fireEvent) {
            try {
                this.emit('change', {value: viewValue});
            } catch (err) {
                console.error('unhandled change event error:', this.model.getFullName(), err);
            }
            this.parent.onFieldChange({source: this});
        }
    }
    onBlur2 = (viewValue, fireEvent = false) => {
        // console.log('RowFormDateTimeFieldController.onBlur2', viewValue);
        if (!this.isEditable()) return;
        this.validate2();
        if (this.isValid()) {
            this.copyValueToModel();
        }
        this.refreshChanged();
        if (fireEvent) {
{'fraction_non_alphanumeric': 0.1325478645066274, 'fraction_numerical': 0.010730065221965075, 'mean_word_length': 1.9327575570635411, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5148051', 'n_tokens_mistral': 1348, 'n_tokens_neox': 1347, 'n_words': 234}