框架7获取范围日期选择器的值

时间:2023-01-05 20:14:56

i trigger range date picker from a button , let say i have

我从按钮触发范围日期选择器,让我说我有

how to set value the selected range date to my

如何设置所选范围日期的值到我的

, thank you in advance

, 先感谢您

var date=new Date();
var tgl=date.getDate();
var bln=date.getMonth();
var thn=date.getFullYear();
var calendarRange = myApp.calendar({
    input: '#calendar-range',
    dateFormat: 'M dd yyyy',
    rangePicker: true,
    onClose:function(){

        $$("#selected-date").removeClass("hidden");
        // $$("#selected-date").val(calendarRange.value);
        alert(calendarRange.value);

    },
    disabled:{
        to: new Date(thn, bln, (tgl-1))
    }

});

2 个解决方案

#1


0  

Try this:

onChange: function(p,values,displayValues){
             var start= new Date(values[0]);
             var end = new Date(values[1]); 
}

#2


0  

function onclickCash() {
    var myPicker = $('#calendar-range').val();
    console.log(myPicker);
}

#1


0  

Try this:

onChange: function(p,values,displayValues){
             var start= new Date(values[0]);
             var end = new Date(values[1]); 
}

#2


0  

function onclickCash() {
    var myPicker = $('#calendar-range').val();
    console.log(myPicker);
}