This file contains 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
// Basado en la formula de matemática financiera: | |
// https://luismasanchezmaestre.files.wordpress.com/2014/08/calculo-anualidad.jpg | |
var a = 0; | |
// Monto | |
var co = 5700; | |
// Años | |
var n = 13; | |
// Pagos Anuales | |
var m = 12; | |
// Tasa Interes |
This file contains 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
var numeroALetras = (function() { | |
// Código basado en el comentario de @sapienman | |
// Código basado en https://gist.github.com/alfchee/e563340276f89b22042a | |
function Unidades(num) { | |
switch (num) { | |
case 1: | |
return 'UN'; | |
case 2: | |
return 'DOS'; |
This file contains 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
[ | |
{ | |
"CODPAIS": 93, | |
"DESPAIS": "AFGANISTAN" | |
}, | |
{ | |
"CODPAIS": 355, | |
"DESPAIS": "ALBANIA" | |
}, | |
{ |
This file contains 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
[ | |
{ | |
"DESDEPTO": "AHUACHAPAN", | |
"CODDEPTO": 1 | |
}, | |
{ | |
"DESDEPTO": "SANTA ANA", | |
"CODDEPTO": 2 | |
}, | |
{ |
This file contains 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
[ | |
{ | |
"DESCIUDAD": "AHUACHAPAN", | |
"CODDEPTO": 1, | |
"CODCIUDAD": 1 | |
}, | |
{ | |
"DESCIUDAD": "APANECA", | |
"CODDEPTO": 1, | |
"CODCIUDAD": 2 |
This file contains 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
[ | |
{ | |
"CODPROFESI": 1, | |
"DESPROFESI": "ABOGADO" | |
}, | |
{ | |
"CODPROFESI": 2, | |
"DESPROFESI": "AEROTECNICO" | |
}, | |
{ |
This file contains 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
document.head.appendChild(Object.assign( | |
document.createElement('script'), | |
{ src: 'https://momentjs.com/downloads/moment-with-locales.js' } | |
)); | |
// Example | |
console.log(moment("2011-10-31", "YYYY-MM-DD").format('DD/MM/YYYY')); |
This file contains 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
var run = () => { | |
var birth = new Date("1999-3-22"); | |
var curr = new Date(); | |
var diff = curr.getTime() - birth.getTime(); | |
console.log("Edad: " + Math.floor(diff / (1000 * 60 * 60 * 24 * 365.25))); | |
} | |
run(); |
This file contains 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
import java.time.LocalDate; | |
// New calendar instance | |
Calendar calendar = GregorianCalendar.getInstance(); | |
LocalDate dt = LocalDate.parse("2020-01-15"); | |
Integer day = 0, month = 0, year = 0; | |
year = dt.getYear(); |
This file contains 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
const rows = [ | |
["name1", "city1", "some other info"], | |
["name2", "city2", "more info"] | |
]; | |
let csvContent = "data:text/csv;charset=utf-8," + rows.map(e => e.join(",")).join("\n"); | |
var encodedUri = encodeURI(csvContent); | |
var link = document.createElement("a"); | |
link.setAttribute("href", encodedUri); |
OlderNewer