Skip to content

Instantly share code, notes, and snippets.

View WenderGalan's full-sized avatar
🎯
Focusing

Wender Galan WenderGalan

🎯
Focusing
View GitHub Profile
/**
* @param dataHoraEntrada
* @param dataHoraDiff
* @param seconds
* @returns {`${number}h ${string}m ${string}s`}
*/
export const calcularTempoEspera = (dataHoraEntrada, dataHoraDiff, seconds) => {
// start time and end time
let startTime = moment(dataHoraEntrada, 'DD/MM/YYY hh:mm:ss')
let endTime = moment(dataHoraDiff, 'DD/MM/YYY hh:mm:ss').add(seconds, 'seconds')
@WenderGalan
WenderGalan / jspdf.html
Last active March 12, 2020 21:10
Generates a PDF based on an HTML page.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/1.4.1/jspdf.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/canvas2image@1.0.5/canvas2image.min.js"></script>
</head>
<script language="javascript">