質問

I am using jquery datepicker, I want it for daterange in one textbox not seperate inputs.

$(function () {
    $("#from").datepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 3,
        onClose: function (selectedDate) {
            $("#to").datepicker("option", "minDate", selectedDate);
        }
    });
    $("#to").datepicker({
        defaultDate: "+1w",
        changeMonth: true,
        numberOfMonths: 3,
        onClose: function (selectedDate) {
            $("#from").datepicker("option", "maxDate", selectedDate);
        }
    });
});

This is the date-range in different inputs, how can I merge it in one input?

And I am building the site in 3 language with asp.net localisation, it changes with cultureinfo like "en" or "en-GB", how can I change language of datepicker with asp.net culture?

役に立ちましたか?

解決

Datepicker doesn't have this functionality anymore, but there are loads of plugins and extensions that does.

http://dubrox.blogspot.se/2010/09/multiple-dates-picker-for-jquery-ui.html

http://keith-wood.name/datepick.html#range

http://multidatespickr.sourceforge.net/

https://github.com/dangrossman/bootstrap-daterangepicker/

A quick Google search will reveal even more.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top