title: Is it possible to make an HTML datetime-local element produce only valid dates?
body: <p>I am using an HTML <code>datetime-local</code> element to get a datetime from the user. The problem with this input field is that it allows the user to input values that cannot be converted to JavaScript <code>Date</code> objects. Some possible inputs are too large, for example the following date is too large: </p>
  
  <p><img src="https://i.stack.imgur.com/V6YO1.png" alt="invalid date"></p>
  
  <p>Here is what happens when I get its value using JavaScript:</p>
  
  <pre><code>var input = document.getElementById("__Date");
  var time = input.value; // is "121212-12-12T12:12" right now
  var value = new Date(time); // I get an error here - "Invalid Date"
  </code></pre>
  
  <p>Here is the complete element in question. I am using Google Chrome v37 to run this code.</p>
  
  <pre><code>&lt;input type="datetime-local" class="input-block-level EditableAttributeValue" autocomplete="off" autocorrect="off" id="__Date" max="2015-00-00T00:00:00:00"&gt;
  </code></pre>
  
  <p>I need a way to disallow these invalid inputs, preferably without using any JavaScript to listen to changes and validate the input by hand.</p>