Skip to content

Shown calendar dates outside current month and larger than max makes next arrow disabled #582

@stefannygard

Description

@stefannygard

(issue should be labeled datepicker)

If I currently (2011) show the month November, some dates in December are also shown. If any of those December-dates are larger than max date (lets say max is set to December 6th), the next arrow (i.e. the arrow icon that points right and when clicked shows the next month) will be hidden.

I have included a patch that should clearify the problem and solution.

--- jquery.tools.dateinput.js   (revision 6937)
+++ jquery.tools.dateinput.js   (working copy)
@@ -555,12 +555,16 @@
                        weeks.append(week);         
                    }                   

+                   isOff = false;
+                   
                    if (j < begin)  { 
+                       isOff = true;
                        a.addClass(css.off); 
                        num = prevDays - begin + j + 1;
                        date = new Date(year, month-1, num);

                    } else if (j >= begin + days)  {
+                       isOff = true;
                        a.addClass(css.off);    
                        num = j - days - begin + 1;
                        date = new Date(year, month+1, num);
@@ -585,7 +589,8 @@
                    }

                    if (max && date > max) {
-                       a.add(nm).addClass(css.disabled);                       
+                       a.addClass(css.disabled);                       
+                       if(!isOff) { nm.addClass(css.disabled); }
                    }

                    a.attr("href", "#" + num).text(num).data("date", date); 

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy