• Kendo 日期控件


    起始日期<input id="start"> 结束日期<input id="end">

    <input id="datepicker" style="150px;" />
    <script type="text/javascript">
    $(document).ready(function () {
    $("#datepicker").kendoDatePicker({ format: "yyyy-MM-dd" });//

    });

    $(document).ready(function () {
    function startChange() {
    var startDate = start.value(),
    endDate = end.value();

    if (startDate) {
    startDate = new Date(startDate);
    startDate.setDate(startDate.getDate());
    end.min(startDate);
    } else if (endDate) {
    start.max(new Date(endDate));
    } else {
    endDate = new Date();
    start.max(endDate);
    end.min(endDate);
    }
    }

    function endChange() {
    var endDate = end.value(),
    startDate = start.value();

    if (endDate) {
    endDate = new Date(endDate);
    endDate.setDate(endDate.getDate());
    start.max(endDate);
    } else if (startDate) {
    end.min(new Date(startDate));
    } else {
    endDate = new Date();
    start.max(endDate);
    end.min(endDate);
    }
    }

    var today = kendo.date.today();

    var start = $("#start").kendoDateTimePicker({
    value: today,
    change: startChange,
    parseFormats: ["MM/dd/yyyy"]
    }).data("kendoDateTimePicker");

    var end = $("#end").kendoDateTimePicker({
    value: today,
    change: endChange,
    parseFormats: ["MM/dd/yyyy"]
    }).data("kendoDateTimePicker");

    start.max(end.value());
    end.min(start.value());
    });


    </script>

  • 相关阅读:
    ASP.NET获取客户端IP地址Marc地址
    WPF(MultiBinding 数据对比验证,启用提交)
    WPF(Binding of ObjectDataProvider)
    WPF(附加属性 Slider)
    WPF(Binding of ItemsControl)
    WPF( 数据验证)
    WPF(依赖属性)
    WPF(附加属性)
    WPF(Binding of RelativeSource)
    WPF(Binding of LinQ)
  • 原文地址:https://www.cnblogs.com/914556495wxkj/p/6675998.html
Copyright © 2020-2023  润新知