Skip to content

Instantly share code, notes, and snippets.

@umutyerebakmaz
Last active March 15, 2023 13:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save umutyerebakmaz/559560cc5a85fca9387176a968a59a6e to your computer and use it in GitHub Desktop.
Save umutyerebakmaz/559560cc5a85fca9387176a968a59a6e to your computer and use it in GitHub Desktop.
datetime-difference-detector.ts
const now = new Date();
const scheduledDate = new Date(this.element.scheduledDate);
const diff = scheduledDate.getTime() - now.getTime();
diff < 0 ? (this.showWarningColor = true) : (this.showWarningColor = false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment