Skip to content

Instantly share code, notes, and snippets.

@almcarvalho
Created February 22, 2024 19:17
Show Gist options
  • Save almcarvalho/1722ac6e6606152be7684f021d552de5 to your computer and use it in GitHub Desktop.
Save almcarvalho/1722ac6e6606152be7684f021d552de5 to your computer and use it in GitHub Desktop.
if (user) {
if (user.dataVencimento) {
const diferencaEmMilissegundos = new Date().getTime() - user.dataVencimento.getTime();
const diferencaEmDias = Math.floor(diferencaEmMilissegundos / (1000 * 60 * 60 * 24));
console.log("atraso: " + diferencaEmDias);
if (diferencaEmDias > 10) {
warningMsg = `seu plano está bloqueado, entre em contato com o setor financeiro!`
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment