Permalink
Browse files

Let datepicker jump one month forward

Test Plan: Clicked on next month, didn't see year 20121.

Reviewers: epriestley

Reviewed By: epriestley

CC: aran, Korvin

Differential Revision: https://secure.phabricator.com/D4277
  • Loading branch information...
1 parent f2639e5 commit e05d8d7061f3351c6f2686743ddcb17adffcc16b vrana committed Dec 22, 2012
View
2 src/__celerity_resource_map__.php
@@ -1350,7 +1350,7 @@
),
'javelin-behavior-fancy-datepicker' =>
array(
- 'uri' => '/res/ae843244/rsrc/js/application/core/behavior-fancy-datepicker.js',
+ 'uri' => '/res/0a1bc610/rsrc/js/application/core/behavior-fancy-datepicker.js',
'type' => 'js',
'requires' =>
array(
View
16 webroot/rsrc/js/application/core/behavior-fancy-datepicker.js
@@ -80,9 +80,9 @@ JX.behavior('fancy-datepicker', function(config) {
var read_date = function() {
var i = get_inputs();
- value_y = i.y.value;
- value_m = i.m.value;
- value_d = i.d.value;
+ value_y = +i.y.value;
+ value_m = +i.m.value;
+ value_d = +i.d.value;
};
var write_date = function() {
@@ -216,16 +216,14 @@ JX.behavior('fancy-datepicker', function(config) {
switch (p[0]) {
case 'm':
// User clicked left or right month selection buttons.
- value_m = value_m - 1;
value_m = value_m + parseInt(p[1]);
- if (value_m >= 12) {
+ if (value_m > 12) {
value_m -= 12;
- value_y += 1;
- } else if (value_m < 0) {
+ value_y++;
+ } else if (value_m <= 0) {
value_m += 12;
- value_y -= 1;
+ value_y--;
}
- value_m = value_m + 1;
break;
case 'd':
// User clicked a day.

0 comments on commit e05d8d7

Please sign in to comment.