JSFiddle - React, Tailwind, and code Playground

by Akhil Dayanandan

HTML

<input type="text" class="DateTextBox" data-dateformat='dd/mm/yy'>
</br>
<input type="text" class="DateTextBox" data-dateformat='dd/MM/yy'>
</br>
<input type="text" class="DateTextBox" data-dateformat='d/M/yy'>
</br>
<input type="text" class="DateTextBox" data-dateformat='d/MM/yy'>

CSS

.DateTextBox{    
    margin-bottom:20px;
}

JavaScript

$('.DateTextBox').datepicker({ dateFormat: $(this).attr('data-dateformat'),
                showButtonPanel: true,
                changeMonth: true,
                changeYear: true,
                defaultDate: new Date(),
                changeMonth: true,
                changeYear: true
            });