Skip to content

Instantly share code, notes, and snippets.

@pnchinmay
Forked from AnKingMed/Calculate Exam Date
Created June 27, 2023 10:33
Show Gist options
  • Save pnchinmay/8b4f2b45889122762950d0e1a117f86a to your computer and use it in GitHub Desktop.
Save pnchinmay/8b4f2b45889122762950d0e1a117f86a to your computer and use it in GitHub Desktop.
This is code that can be placed on Anki Cards to help
<div style="font-size:20px;color:#F2E48E;font-family:Times;
font-style:italic;letter-spacing:-2px;position:fixed;bottom:50px;
left:5px;opacity:.9;">
<div class="editcloze">
Ease: {{info-Factor:}}
</div>
<span id="countdown2"></span>
<script>
// ###### CUSTOMIZE DATE HERE ######
var dateText= 'June 18 2022';
var now = new Date().getTime();
var targetDate= new Date(dateText).getTime();
var dist = targetDate- now;
var days = ((dist / (1000 * 60 * 60 * 24))/30).toFixed(1);
document.getElementById('countdown2').innerHTML = days;
</script>m (<span id="countdown"></span>
<script>
var now = new Date().getTime();
var targetDate= new Date(dateText).getTime();
var dist = targetDate- now;
var days = Math.ceil(dist / (1000 * 60 * 60 * 24));
document.getElementById('countdown').innerHTML = days;
</script>d)
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment