JSFiddle - React, Tailwind, and code Playground

by lega911

HTML

<script src="https://angularlight.org/bin/alight_0.14.last.min.js"></script>
<link rel="stylesheet" href="https://code.jquery.com/ui/1.12.0/themes/smoothness/jquery-ui.css">
<script src="https://code.jquery.com/ui/1.12.0/jquery-ui.min.js"></script>
<div al-app>
  <div as-datepicker="value"></div>
  <h1>value: {{value}}</h1>
  <div as-datepicker="value"></div>
</div>

CSS

.ui-datepicker {font-size:11px;}

JavaScript

alight.directives.as = {
	datepicker: function(data, elm, key) {
    $(elm).datepicker({
      onSelect: (value) => {
        this.setValue(key, value);
        this.scan();
      }
    });
    
    this.watch(key, (value) => $(elm).datepicker('setDate', value));
  }
};