<commit_before>var _input = createElement("input");
function input(element) {
    if (element && /input/i.test(element.tagName)) {
        var type = element.getAttribute("type");
        if (type) {
            var format;
            switch (type.toLowerCase()) {
                case "date":
                    format = "年月日";
                    element.getValue = function () {
                        return new Date(this.value);
                    };
                    element.setValue = function (value) {
                        var date = new Date(value);
                        this.value = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(a => a < 10 ? '0' + a : a).join("-");
                    };
                    break;
                case "datetime":
                    format = "年月日时分秒";
                    element.getValue = function () {
                        return new Date(this.value);
                    };
                    element.setValue = function (value) {
                        this.value = new Date(value).toLocaleString(undefined, { hour12: false });
                    };
                    break;
            }
            if (format) {
                select(element, selectDate(format, input.value));
                element.readonly = "readonly";
            }
        }
        return element;
    }
    return createElement(_input);
}<commit_msg>添加money类型<commit_after>var _input = createElement("input");
var number = function () {
    var reg = /^[\s\S]*?(\d+)(\.\d*)?[\s\S]*$/;
    var value;
    if (!reg.test(this.value)) value = '';
    else value = this.value;
    value = String(value).replace(reg, "$1$2");
    if (this.value !== value) this.value = value;
    console.log(this.value, value);
};
function input(element) {
    if (element && /input/i.test(element.tagName)) {
        var type = element.getAttribute("type");
        if (type) {
            var format;
            switch (type.toLowerCase()) {
                case "date":
                    format = "年月日";
                    element.getValue = function () {
                        return new Date(this.value);
                    };
                    element.setValue = function (value) {
                        var date = new Date(value);
                        this.value = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(a => a < 10 ? '0' + a : a).join("-");
                    };
                    break;
                case "datetime":
                    format = "年月日时分秒";
                    element.getValue = function () {
                        return new Date(this.value);
                    };
                    element.setValue = function (value) {
                        this.value = new Date(value).toLocaleString(undefined, { hour12: false });
                    };
                    break;
                case "money":
                    on("input")(element, number);
                    break;
            }
            if (format) {
                select(element, selectDate(format, input.value));
                element.readonly = "readonly";
            }
        }
        return element;
    }
    return createElement(_input);
}
{'fraction_non_alphanumeric': 0.13024691358024693, 'fraction_numerical': 0.004320987654320987, 'mean_word_length': 1.203263086335826, 'pattern_counts': {'":': 5, '<': 5, '<?xml version=': 0, '>': 5, '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': '6497915', 'n_tokens_mistral': 848, 'n_tokens_neox': 800, 'n_words': 175}