1. Matthew Schinckel
  2. jqui

Commits

Matthew Schinckel  committed f11f8ad

Better (correct, actually) movement from week to week

  • Participants
  • Parent commits e8bef02
  • Branches default

Comments (0)

Files changed (3)

File js/jqui.js

View file
     var d = new Date();
     var date = isoDate.split('-');
     d.setFullYear(date[0]);
-    d.setMonth(date[1]);
+    d.setMonth(date[1]-1);
     d.setDate(date[2]);
     return d;
   }
   function nextMonth(e) {
     // Go to the next month.
     var date = parseDate(dp.attr('date'));
-    date.setMonth(date.getMonth()-1);
+    date.setDate(1);
+    date.setMonth(date.getMonth()+1);
     dp.attr('date', date.toISOString().split('T')[0]);
     redraw();
     e.stopPropagation();
   function prevMonth(e) {
     // Go to the previous month.
     var date = parseDate(dp.attr('date'));
-    date.setMonth(date.getMonth()+1);
+    date.setDate(1);
+    date.setMonth(date.getMonth()-1);
     dp.attr('date', date.toISOString().split('T')[0]);
     redraw();
     e.stopPropagation();

File test/index.haml

View file
     %h3 Datepicker
     %h2 Datepicker fields
     %input{:type=>:date}
+      input type=date
+      %br
     %input{:type=>:month}
     %input{:type=>:week}
     %input{:type=>:time}

File test/index.html

View file
     <input placeholder='Enter website address' type='url' />
     <h3>Datepicker</h3>
     <h2>Datepicker fields</h2>
-    <input type='date' />
+    <input type='date'>
+      input type=date
+      <br />
+    </input>
     <input type='month' />
     <input type='week' />
     <input type='time' />