Navigation

Lottery Calc

Places the Financial Aid Lottery Deferred 16 Months Projection Calculator
<div class="container"> <p>Starting in 2017, New Mexico high school graduates or New Mexico high school equivalency recipients will have up to sixteen months from the date they receive their high school crediential to begin their post-secondary education and complete their Qualifying Term.</p> <p>To determine the qualifying term for a student who wants to take advantage of the sixteen month deferment program, enter the students graduation date below.</p> <div class="entry"> <form> <div><p>Graduation Date</p></div> <input name ="entereddate" type="date" id="entereddate"> <input id="subbut" type="button" value="Submit" onmousedown="submitDate()"> </form> <div id="datetext"></div> </div> <div class="result"> <div><p> + 16 Months</p></div> <div id="datetextplus16months">??/??/????</div> <div class="resulttext"><p>Student must register before this date.</p></div> </div> <p class="fineprint">*Note: Qualifying term can be completed in Fall or Spring only.</p> </div>
div.container { min-width: 660px; } div { margin-bottom: 15px; } div.entry, div.result { float: left; padding: 15px; } div.entry p, div.result p { margin: 6px 0; } div.entry div, div.result div { float: left; clear: left; margin: 0; } p, input, div#datetextplus16months { font-family: Arial, Helvetica, sans-serif; font-size: 15px; } input#entereddate, div#datetextplus16months { border: 2px solid grey; border-radius: 2px; height: 18px; margin: 0; padding: 3px; } input#entereddate { float: left; clear: left; min-width: 165px; text-align: center; } div#datetextplus16months { width: 100px; text-align: center; } input#subbut { color: white; background: navy; border: 0; border-radius: 2px; margin: 8px 12px 8px 0; padding: 6px 7px; float: left; clear: left; text-transform: uppercase; font-size: smaller; } div.result div.resulttext { clear: none; padding: 5px 0 0 8px; } div.resulttext p { margin: 0; } div#datetext { float: left; clear: none; display: block; width: 95px; margin: 6px 0 0; } div#datetext p.help { font-size: small; color: darkred; margin: 0; } p.fineprint { font-style: italic; font-size: small; font-weight: bold; clear: both; }
var datefieldtest = document.createElement("input"); datefieldtest.setAttribute("type", "date"); if (datefieldtest.type != "date") { var scriptadd = document.createElement('span'); scriptadd.append('<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css">'); scriptadd.append('<script src="//code.jquery.com/jquery-1.12.4.js"><\/script>'); scriptadd.append('<script src="//code.jquery.com/ui/1.12.1/jquery-ui.js"><\/script>'); if (datefieldtest.type != "date") { document.addEventListener("DOMContentLoaded", function(event) { $('#entereddate').datepicker(); }); }; var calculatingDays = false; var calculatingMonths = true; var monthsToAdd = 16; var daysToAdd = 480; var userentereddatefield = document.getElementById('entereddate'), datetext = document.getElementById('datetext'), datetextplus16months = document.getElementById('datetextplus16months'); function submitDate() { userentereddate = userentereddatefield.value; if (userentereddatefield.value == '') { datetext.innerHTML = '<p class="help">Please submit graduation date.</p>'; } else { var date = new Date(userentereddate.replace(/-/g, "/")); datetext.innerHTML = ''; if (calculatingDays && calculatingMonths) { console.log("Please choose to calculate either days or months") } else if (calculatingDays) { datetextplus16months.innerHTML = date.addDays(daysToAdd).toLocaleDateString("en-US"); } else if (calculatingMonths) { datetextplus16months.innerHTML = date.addMonths(monthsToAdd).toLocaleDateString("en-US"); } else { console.log("Will only calculate either days or months"); } } }; Date.prototype.addDays = function(days) { var date = new Date(this.valueOf()); date.setDate(date.getDate() + days); return date; }; Date.prototype.addMonths = function (m) { var d = new Date(this); var years = Math.floor(m / 12); var months = m - (years * 12); if (years) d.setFullYear(d.getFullYear() + years); if (months) d.setMonth(d.getMonth() + months); return d; };
no