1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-01 11:12:42 +01:00

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
This commit is contained in:
vrana 2012-12-21 16:34:35 -08:00
parent f2639e528c
commit e05d8d7061
2 changed files with 8 additions and 10 deletions

View file

@ -1350,7 +1350,7 @@ celerity_register_resource_map(array(
), ),
'javelin-behavior-fancy-datepicker' => 'javelin-behavior-fancy-datepicker' =>
array( 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', 'type' => 'js',
'requires' => 'requires' =>
array( array(

View file

@ -80,9 +80,9 @@ JX.behavior('fancy-datepicker', function(config) {
var read_date = function() { var read_date = function() {
var i = get_inputs(); var i = get_inputs();
value_y = i.y.value; value_y = +i.y.value;
value_m = i.m.value; value_m = +i.m.value;
value_d = i.d.value; value_d = +i.d.value;
}; };
var write_date = function() { var write_date = function() {
@ -216,16 +216,14 @@ JX.behavior('fancy-datepicker', function(config) {
switch (p[0]) { switch (p[0]) {
case 'm': case 'm':
// User clicked left or right month selection buttons. // User clicked left or right month selection buttons.
value_m = value_m - 1;
value_m = value_m + parseInt(p[1]); value_m = value_m + parseInt(p[1]);
if (value_m >= 12) { if (value_m > 12) {
value_m -= 12; value_m -= 12;
value_y += 1; value_y++;
} else if (value_m < 0) { } else if (value_m <= 0) {
value_m += 12; value_m += 12;
value_y -= 1; value_y--;
} }
value_m = value_m + 1;
break; break;
case 'd': case 'd':
// User clicked a day. // User clicked a day.