highcharts datepicker仅限月份和年份

时间:2014-05-21 11:53:20

标签: jquery highcharts datepicker highstock

这是我的日期选择器,包含高价的日,月和年。我想仅在月份和年份更改我的日期选择器。

onSelect: function( selectedDate ) {
var option = this.id == "from" ? "minDate" : "maxDate",
instance = $( this ).data( "datepicker" ),
date = $.datepicker.parseDate(
     instance.settings.dateFormat || 
     $.datepicker._defaults.dateFormat,
     selectedDate, instance.settings );
dates.not( this ).datepicker( "option", option, date );

var startDate=$("#from")[0].value;
var endDate=$("#to")[0].value;
if (startDate!=="" && endDate!=="") {
    startDate=startDate.split("/");
    endDate=endDate.split("/");
    chart.xAxis[0].setExtremes(
        Date.UTC(startDate[2], startDate[0]-1, startDate[1]),
        Date.UTC(endDate[2], endDate[0]-1, endDate[1])
    );
}

}

0 个答案:

没有答案