text Mascara de dataevalidaçãode数据
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了text Mascara de dataevalidaçãode数据相关的知识,希望对你有一定的参考价值。
$('#DataDeNascimento').keydown(function() {
MaskField(this, Data);
});
-----------------------------------------------------
function CheckDate(pObj) {
var expReg = /^((0[1-9]|[12]\d)\/(0[1-9]|1[0-2])|30\/(0[13-9]|1[0-2])|31\/(0[13578]|1[02]))\/(19|20)?\d{2}$/;
var aRet = true;
if ((pObj) && (pObj.value.match(expReg)) && (pObj.value != '')) {
var dia = pObj.value.substring(0, 2);
var mes = pObj.value.substring(3, 5);
var ano = pObj.value.substring(6, 10);
if ((mes == 4 || mes == 6 || mes == 9 || mes == 11) && dia > 30)
aRet = false;
else
if ((ano % 4) != 0 && mes == 2 && dia > 28)
aRet = false;
else
if ((ano % 4) == 0 && mes == 2 && dia > 29)
aRet = false;
} else
aRet = false;
return aRet;
}
function MaskField(o, f) {
v_obj = o;
v_fun = f;
setTimeout("ExecMask()", 1);
}
function ExecMask() {
v_obj.value = v_fun(v_obj.value);
}
function Data(v) {
v = v.replace(/\D/g, "");
v = v.replace(/(\d{2})(\d)/, "$1/$2");
v = v.replace(/(\d{2})(\d)/, "$1/$2");
v = v.replace(/(\d{2})(\d{2})$/, "$1$2");
return v;
}
以上是关于text Mascara de dataevalidaçãode数据的主要内容,如果未能解决你的问题,请参考以下文章
metamask-mascara-在线钱包使用
text arquivo de config de conexao knex
text Diagrama de la base de datos
text Creacion de stores,store views y guardado de datos de configuracion
(de) 使用 System.Text.Json 序列化流
text ORCL - Nombre de switch de redo log par heures