JSFiddle - React, Tailwind, and code Playground

by Alireza Safian

HTML

<link rel="stylesheet" href="https://code.jquery.com/ui/1.11.3/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.11.3/jquery-ui.min.js"></script>
This has options attr:
<input class="data" type="text" data-options="maxDate: 0" />

This is just a date pick:
<input class="dataWithoutOptions" type="text" />

CSS

input {
  display:block;
  margin:10px 0 20px;
  padding:5px;
}

JavaScript

$("input.dataWithoutOptions").each(function(){
	$(this).datepicker({maxDate:'0'})
});

$("input.data").each(function(){
  var dateOptions=eval('({' + $(this).data('options')+ '})'); 
  
  console.log(JSON.parse($(this).data('options')));
  $(this).datepicker(dateOptions)
});