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
| export function calcDate(date1: any, date2: any) { | |
| //new date instance | |
| const dt_date1 = new Date(date1); | |
| const dt_date2 = new Date(date2); | |
| //Get the Timestamp | |
| const date1_time_stamp = dt_date1.getTime(); | |
| const date2_time_stamp = dt_date2.getTime(); |
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
| /* | |
| Créditos a Sebastian Wilson | |
| https://codepen.io/swilsont/pen/poLGxZe | |
| Ayuda a buscar la próxima hora disponible en el Registro Civil. | |
| Genera un archivo de texto plano donde las columnas son separadas usando $separator . | |
| Este archivo puede ser cargado posteriormente en Excel, y al ordenar por la columna 'fecha_hora' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| const banda = 'Metallica' | |
| const genero = 'Heavy Metal' | |
| const canciones = ['Master of Puppets', 'Enter Sandman', 'Seek & Destroy'] | |
| //Object Literal Enhacement | |
| const metallica = {banda, genero, canciones}; | |
| //Object Destructuring | |
| const {banda, genero, canciones} = metallica |
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
| function highlight(strings, ...values){ | |
| let str = ''; | |
| strings.forEach((string, i) => { | |
| str += `${string} <span class="hl">${values[i] || ''}</span>`; | |
| }); | |
| return str; | |
| } | |
| const name = 'Snickers'; | |
| const age = 100; |
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
| //Validar rut | |
| function cleanRut(_value) { | |
| return typeof _value === 'string' ? _value.replace(/[^0-9kK]+/g,'').toUpperCase() : ''; | |
| } | |
| function formatRut(_value, _default) { | |
| _value = cleanRut(_value); | |
| if(!_value) return _default; | |
| if(_value.length <= 1) return _value; |
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
| const pasarAlturaACms = persona => ({ | |
| ...persona, | |
| altura: persona.altura * 100 | |
| }) | |
| let personasCms = personas.map(pasarAlturaACms) |
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
| const reducer = (acum, { cantidadDeLibros }) => acum + cantidadDeLibros | |
| let totalDeLibros = personas.reduce(reducer, 0) |
NewerOlder