title: Removing (or allowing) ordinal characters from dynamic text with Date.parse();
body: <p>I am building a self-depreciating list of dates and am using <code>Date.parse()</code> to convert rich text into a timestamp. Right now, we have a system where the user enters the date themselves, and I use a token on the backend to pull it through to that specific page.</p>
  
  <p>I am trying to 'protect the user' from entering a wrong date format.</p>
  
  <p>Currently, if they enter <code>January 12th, 2016</code> it won't be able to parse and create a timestamp due to <code>th</code>. However, if they enter <code>January 12, 2016</code> it can create a timestamp.</p>
  
  <p>Is there a way to replace these ordinal numbers on a dynamic string? I've tried a simple jquery find/replace, but have had no luck with getting it to remove the ordinal date texts. </p>
  
  <p><strong>What I've tried:</strong></p>
  
  <pre><code>$('.my-button').each(function() {
      console.log($(this).text());
      var text = $(this).text().replace('st, ', '');
      $(this).text(text);
  });
  </code></pre>
  
  <p>Any ideas on a solution, or a way to make <code>Date.parse():</code> accept these extra characters?</p>