JSFiddle - React, Tailwind, and code Playground

by Kabir Hossain

HTML

<script
  src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"
  integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU="
  crossorigin="anonymous"></script>
  
<span class="date">06-Aug-2012</span>
<span class="date">2012/06/Aug</span>
<span class="date">Monday, August 06, 2012</span>

JavaScript

$(document).ready(function () {
    $('span.date').each(function() { 
        var dateFormat = $(this).text()
        var dateFormat = $.datepicker.formatDate('DD, MM d, yy', new Date(dateFormat));
        //alert(dateFormat);
        $(this).html(dateFormat + "<br>");
    });
});