Created
March 16, 2022 16:42
-
-
Save dantetesta/cdf471c83dbd0b0eacec403f35228536 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
jQuery( document ).ready(function() { | |
function pad(num, size) { | |
var s = num+''; | |
while (s.length < size) s = '0' + s; | |
return s; | |
} | |
jQuery('#total').hide(); | |
jQuery('#número-fatura').css('pointer-events','none'); | |
var total = 1 + parseInt(jQuery('#total h2').text()); | |
var data = new Date(); | |
var mes = data.getMonth(); | |
var ano = data.getFullYear(); | |
var result = pad(total,4) + '-' + mes +'/' + ano; | |
jQuery('#numero-fatura').val(result); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment