Created
October 26, 2017 08:32
-
-
Save klashxx/51ed684e31fe34dbda481e5f8dd7f87a 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
| function formatMins(minutos) { | |
| var mins_num = parseInt(minutos, 10) | |
| if (mins_num == undefined) { | |
| return 'Indeterminado.' | |
| } | |
| if (mins_num < 60 ){ | |
| return mins_num + ' minutos.' | |
| } | |
| var horas = Math.floor(mins_num / 60) | |
| var mins = Math.floor((mins_num - ((horas * 3600)) / 60)) | |
| if (horas < 10) {horas = '0' + horas} | |
| if (mins < 10) {mins = '0' + mins} | |
| return horas + ' Horas y ' + mins + ' minutos.' | |
| } | |
| // formatMins(Math.floor((new Date - start) / 1000 /60))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment