有没有办法在magento日历中获得类似于this的内容?
这是我的代码:
Calendar.setup({
inputField: "myfield",
ifFormat: "%m/%e/%Y",
showsTime: false,
button: "_myfield_date_trig",
align: "Bl",
singleClick : true,
disableFunc: function(date) {
// show only month and year
}
});
答案 0 :(得分:0)
您可以尝试this并应用css来隐藏ui日历
<div class="control customer-dob">
<input type="text"
class="input-text required-entry hasDatepicker"
id="calendar_inputField"
name="calendar_inputField"
aria-required="true" />
<script>
require([
"jquery",
"mage/calendar"
], function ($) {
$("#calendar_inputField").calendar({
changeYear: true,
changeMonth: true,
dateFormat: 'MM/yy',
yearRange: "2017:2050",
onClose: function(dateText, inst) {
$(this).datepicker('setDate', new Date(inst.selectedYear, inst.selectedMonth, 1));
}
});
});
</script>