Closed dinami-k closed 5 years ago
Calendarpicker not contains method setMaxDate. To change max date You must change attribute data-max-date
i set $('#mycalendar').attr('data-max-date', '2019/29/06'); before Metro.init(); and work..... but in runtime after user set some conditions in my page and try $('#mycalendar').attr('data-max-date', '2019/12/12') not work :(
I did a sandbox (https://sandbox.org.ua/dinami-k/code/VwGD7F2vbq) but after save show 404 not found.
sandbox is: Metro4 + VueJS
HTML
<div id="app">
<input id="mycalendar" type="text" data-role="calendarpicker">
</div>
Javascript
var app = new Vue({
el: '#app',
data: {
message: 'Hello Metro 4 + Vue!'
},
mounted: function () {
$('#mycalendar').attr('data-max-date', '2019/05/30') //work
Metro.init();
$('#mycalendar').attr('data-max-date', '2019/05/31') // not work :(
}
});
result: calendar max date 2019/05/30 work ( before Metro.init() )... after .init() not work
@dinami-k You are right. I found a bug in a calendar component. If ix it in 4.2.44
thanks a lot
In runtime i call setMaxDate method but not working....
debug metro.js and setMaxDate method change "o.maxDate" but when call "_drawContent" use "max" property for evaluate condition and not "maxDate"
I changed a local version de Metro.js and edit setMaxDate (add: this.max = new Date(o.maxDate);) like this:
i don`t if it's best approach