racheev,
<script>
var db = {"today":"09","year":"2018","month":"07","dayofmonth":"31","date":"2018-07","tomonth":"06","toyear":"2018","next":"2018-08","prev":"2018-06","day":"7","positions":[{"d":"10"},{"d":"11"}]};
var view = db['positions'];
var busy = view.map(function(e) {
return +e.d
});
var length = +db['dayofmonth'];
var today = +db['today'];
for (var i = 0; i < length; i++) {
var num = i + 1;
var html = num + '<br><input class="check" type="checkbox" name="day_view[]" value="" onclick="clk(this);">'
if (busy.indexOf(num) > -1 || num < today ) html = num + '<br>-'
document.write(html+"<br>")
}
</script>