Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
var y = date.getYear();
var yy = y-2
var year = (yy < 1000) ? yy + 1900 : yy;
Bad habit. I should be using getFullYear()
Right, but it doesn't solve my original question...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[URL unfurl="true"]http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">[/URL]
<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml">[/URL]
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<script type="text/javascript">
var months = new Array("January", "February", "March",
"April", "May", "June", "July", "August", "September",
"October", "November", "December");
function writeMonthOptions() {
var today = new Date();
var date = new Date(today);
date.setFullYear(date.getFullYear() - 3)
var dropDown = document.getElementById("Month_list");
var i = 0;
var optionValues;
while (today.getTime() >= date.getTime()) {
optionValues = months[today.getMonth()] + ' ' + today.getFullYear();
dropDown.options[i++] = new Option(optionValues, optionValues)
today.setMonth(today.getMonth() - 1);
}
}
window.onload = writeMonthOptions;
</script>
<style type="text/css"></style>
</head>
<body>
<select id="Month_list"></select>
</body>
</html>
var dropDown = document.getElementById("Month_list");