Sha256: 4698cfe1c27b02bdaf11ad1e5af63b23bc7167089e8e4b2bb48c3fd611ce6eae

Contents?: true

Size: 859 Bytes

Versions: 15

Compression:

Stored size: 859 Bytes

Contents

function somenteNumeros(event)
{
    return !(event.charCode >= 32 && (event.charCode < 48 || event.charCode > 57));
}

function mascaraData(elemento, event)
{
	/* 8 = backspace; 9 = tab */
	if (event.keyCode == 8 || event.keyCode == 9)
		return true;

	if (elemento.value.length >= 10)
		return false;

    if (elemento.value.length == 2)
    {
        elemento.value +=  '/' ;
        return true;
    }
    else if (elemento.value.length == 5)
    {
        elemento.value += '/';
        return true;
   }

    return somenteNumeros(event);
}

function mascaraHora(elemento, event)
{
	/* 8 = backspace; 9 = tab */
	if (event.keyCode == 8 || event.keyCode == 9)
		return true;

	if (elemento.value.length >= 5)
		return false;

  if (elemento.value.length == 2)
  {
      elemento.value +=  ':' ;
      return true;
  }

  return somenteNumeros(event);
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
uenf_layout-1.3.12 app/assets/javascripts/mascaras.js
uenf_layout-1.3.11 app/assets/javascripts/mascaras.js
uenf_layout-1.3.10 app/assets/javascripts/mascaras.js
uenf_layout-1.3.9 app/assets/javascripts/mascaras.js
uenf_layout-1.3.8 app/assets/javascripts/mascaras.js
uenf_layout-1.3.7 app/assets/javascripts/mascaras.js
uenf_layout-1.3.6 app/assets/javascripts/mascaras.js
uenf_layout-1.3.5 app/assets/javascripts/mascaras.js
uenf_layout-1.3.3 app/assets/javascripts/mascaras.js
uenf_layout-1.3.2 app/assets/javascripts/mascaras.js
uenf_layout-1.3.0 app/assets/javascripts/mascaras.js
uenf_layout-1.2.0 app/assets/javascripts/mascaras.js
uenf_layout-1.1.1 app/assets/javascripts/mascaras.js
uenf_layout-1.1.0 app/assets/javascripts/mascaras.js
uenf_layout-1.0.2 app/assets/javascripts/mascaras.js