从上个月到本月的jquery多个日期时钟日历屏幕 [英] jquery multiple datepicker calender shade out from previous month to this month

查看:112
本文介绍了从上个月到本月的jquery多个日期时钟日历屏幕的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

阻止这个问题的可能方法是什么?

What is the possible way to stop this issue ?

请检查以下给定的提示者。 http://jsfiddle.net/cse_tushar/3t4j9/4/

Please check the below given fiddler. http://jsfiddle.net/cse_tushar/3t4j9/4/

<input id="datePick" type="text"/>

$('#datePick').multiDatesPicker();


所以,让我们说你选择了2013年8月8日和2013年9月9日
当您从9月份选择另外一个时,您会注意到,选择的日历将在8月份显示所选日期的月份。这是它的dafult行为,我认为应该有一种方法来解决它。

in the calender, select a date and then again go to next month and select another day. So, lets say u have selected August 8, 2013 & September 9, 2013 when u select another from september, you will notice as soon selected calender comes up to August month which should be in Sepetember month showing the selected dates. This is the dafult behaviour of it and I think there should be a way to resolve it.

请让我知道

推荐答案

我会尝试像插件文档页面之一的示例。查看这个小提琴。我保持日历的显示是静态的,以避免重置为默认日期。

I'd try something like one of the examples on the plugin docs page. Check out this fiddle. I am keeping the display of the calendar static to avoid the reset to the default date.

HTML

<input id="dates" type="text"/>
<div id="datePick" />

JS

var dates = [];
$('#datePick').multiDatesPicker({
    onSelect: function (e) {
        dates.push(e);
        var dateList = "";
        $.each(dates, function (i, d) {
            if (dateList.length > 0) {
                dateList += ",";
            }
            dateList += d;
        });
        $("#dates").val(dateList);
    }
});

这不一定是最漂亮的js - 我相信它可以更好,但它说明了想想。

It isn't necessarily the prettiest js - I am sure it could be better, but it illustrates the idea.

我相信你可能会遇到的一个问题是 - 你显示什么日期?您不能确保用户将以任何特定顺序选择日期。你总是使用这个月的最后一个选择吗?我想如果你想这样做,你可以勾选onSelect,解析最后一个选择,并将默认日期设置为该月份?这可能是你想要的方式。

I believe one issue you may have is - what date do you display? You cannot assure the user will pick dates in any certain order. Do you always use the last selection for the month? I guess if you wanted to do that you could hook into the "onSelect", parse the last selection and set the default date to that month? That may work the way you'd like.

编辑

我只是看到有一个altField,做同样的事情,我的小提琴。好吧。 :)

I just saw there is an "altField" that does the same thing my fiddle does. Oh well. :)

编辑2

检查这个小提琴。它解析最后的日期(像上面提到的),但我不知道如何设置插件默认的日期。没有编辑插件可能是不可能的。至少这是一个开始...

Check this fiddle. It parses the last date (like I mentioned above) but I am not sure how to set the plugin "default" date. It may not be possible without editing the plugin. At least it is a start...

这篇关于从上个月到本月的jquery多个日期时钟日历屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆