2

我正在使用引导日期范围选择器。我想展示

 10/03/2017  to 10/09/2017 

 09/26/2017  to 10/02/2017

作为选定的日期范围。如何将 css 应用于两个日期范围。

<img src='https://i.imgur.com/77CNX2U.png' />

我正在使用以下配置

$('#demo').daterangepicker({
    "ranges": {
        "Yesterday": [
            "2017-10-08T13:25:32.125Z",
            "2017-10-08T13:25:32.126Z"
        ],
        "Last 7 Days": [
            "2017-10-03T13:25:32.128Z",
            "2017-10-09T13:25:32.128Z"
        ],
        "Last 30 Days": [
            "2017-09-10T13:25:32.128Z",
            "2017-10-09T13:25:32.128Z"
        ],
        "This Month": [
            "2017-09-30T18:30:00.000Z",
            "2017-10-31T18:29:59.999Z"
        ],
        "Last Month": [
            "2017-08-31T18:30:00.000Z",
            "2017-09-30T18:29:59.999Z"
        ],
        "Compare <label class=\"switch\"><input id=\"btnToggle\" type=\"checkbox\" onclick=\"showLables()\" ><span class=\"slider round\"></span></label>": [
            "2017-10-09T13:25:32.128Z",
            "2017-10-09T13:25:32.128Z"
        ]
    },
    "locale": {
        "format": "MM/DD/YYYY ",
        "separator": " - ",
        "applylabel": "Apply",
        "cancellabel": "Cancel",
        "fromlabel": "From",
        "tolabel": "To",
        "customrangelabel": "Custom",
        "daysofweek": [
            "Su",
            "Mo",
            "Tu",
            "We",
            "Th",
            "Fr",
            "Sa"
        ],
        "monthnames": [
            "January",
            "February",
            "March",
            "April",
            "May",
            "June",
            "July",
            "August",
            "September",
            "October",
            "November",
            "December"
        ],
        "firstday": 1
    },
    "linkedCalendars": false,
    "alwaysShowCalendars": true,
    "startDate": "10/01/2017",
    "endDate": "10/10/2017"
}, function(start, end, label) {
  console.log("New date range selected: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD') + ' (predefined range: ' + label + ')");
});

4

0 回答 0