JSFiddle - React, Tailwind, and code Playground
HTML
<link rel="stylesheet" href="https://code.htmlhifive.com/h5.css">
<script src="https://code.htmlhifive.com/ejs-h5mod.js"></script>
<script src="https://hifive.github.io/hifive-res/fw/current/h5.dev.js"></script>
<script src="https://hifive.github.io/hifive-ui-library/hifive-ui-library/WebContent/components/calendar/src/CalendarController.js"></script>
<link rel="stylesheet" href="https://hifive.github.io/hifive-ui-library/hifive-ui-library/WebContent/components/calendar/src/CalendarController.css">
<div id="container"></div>
<p>
<input type="text" id="txtContentDate" size="40" />
<input type="button" id="btnSetTextDate" value="設定">
</p>
JavaScript
$(function(){
var disableDates = [];
var mainController = {
__name : 'h5.ui.container.MainController',
calendarController: h5.ui.components.Calendar,
__meta : {
calendarController: {
rootElement: '#container'
},
},
__init: function(){
this.$find(".select:first").attr("checked", true);
},
'#btnSetTextDate click': function(){
var dates = this.calendarController.getSelectedDate();
var data = this.$find('#txtContentDate').val();
for (var i=0; i<dates.length; i++) {
this.calendarController.setTooltip(dates[i], data);
}
}
};
h5.core.controller('body', mainController);
});