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>
<button id="disable">無効にする</button>
<button id="enable">すべて有効にする</button>
</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);
},
'#disable click': function(context, $el) {
var dates = this.calendarController.getSelectedDate();
disableDates = disableDates.concat(dates);
this.calendarController.setSelectable(dates, false);
},
'#enable click': function(context, $el) {
this.calendarController.setSelectable(disableDates, true);
disableDates = [];
}
};
h5.core.controller('body', mainController);
});