SankhaUI / jquery-datepicker

Automatically exported from code.google.com/p/jquery-datepicker
0 stars 0 forks source link

Multi Month Date Picker #150

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I have try with your multi month date picker with start date and end date, 

but when i select suppose start date through date picker like 18/12/2009
and when i click on the "end-date" input box, the date before the
18/12/2009 are not disable in date picker but it not allow to select date
before 18/12/2009.

so i want dates before the 18/12/2009 in the end-date picker must be disable.

how can i do this?

i have used following code in my js file but it is not working:-

$(document).ready(function()
{   
           $('.date-pick')
                $('#start-date').bind(
                    'dpClosed',
                    function(e, selectedDates)
                    {
                        var d = selectedDates[0];
                        if (d) {
                            d = new Date(d);

$('#end-date').dpSetStartDate(d.addDays(1).asString());
                        }
                    }
                );
                $('#end-date').bind(
                    'dpClosed',
                    function(e, selectedDates)
                    {
                        var d = selectedDates[0];
                        if (d) {
                            d = new Date(d);

$('#start-date').dpSetEndDate(d.addDays(-1).asString());
                        }
                    }
                );

            $('.date-pick')

                    .datePickerMultiMonth({numMonths: 3,createButton:true})
                    .bind(
                        'focus',
                        function(event, message)
                        {
                            if (message == $.dpConst.DP_INTERNAL_FOCUS) {
                                return true;
                            }
                            var dp = this;
                            var $dp = $(this);
                            $dp.dpDisplay();
                            $('*').bind(
                                'focus.datePicker',
                                function(event)
                                {
                                    var $focused = $(this);
                                    if (!$focused.is('.dp-applied')) //
don't close the focused date picker if we just opened a new one!
                                    {
                                        // if the newly focused element
isn't inside the date picker and isn't the original element which triggered
                                        // the opening of the date picker

                                        if
($focused.parents('#dp-popup').length == 0 && this != dp &&
!($.browser.msie && this == document.body)) {
                                            $('*').unbind('focus.datePicker');
                                            $dp.dpClose();
                                        }
                                    }
                                }
                            );
                            return false;
                        }
                    ).bind(
                        'dpClosed',
                        function(event, selected)
                        {
                            $('*').unbind('focus.datePicker');
                        }
                    );
});

sonali
PHP programmer

Original issue reported on code.google.com by sonaliji...@gmail.com on 2 Dec 2009 at 7:32

GoogleCodeExporter commented 9 years ago
Issue 149 has been merged into this issue.

Original comment by kelvin.l...@gmail.com on 2 Dec 2009 at 11:18

GoogleCodeExporter commented 9 years ago
Issue 151 has been merged into this issue.

Original comment by kelvin.l...@gmail.com on 2 Dec 2009 at 1:42

GoogleCodeExporter commented 9 years ago
i have used following code in .ctp file
<ol>
                        <li>
                            <label for="start-date">Date 1:</label>
                            <input name="start_date" id="start-date" class="date-pick" />

                        </li>

                        <li>
                            <label for="end-date">Date 2:</label>
                            <input name="end-date" id="end-date" class="date-pick" />

                        </li>
                        <li>
            </ol>

Original comment by sonaliji...@gmail.com on 3 Dec 2009 at 4:41

GoogleCodeExporter commented 9 years ago
please provide solution of the above problem, its very urgent, i need to do it 
on my
live project

Original comment by sonaliji...@gmail.com on 3 Dec 2009 at 7:16