mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-29 10:12:41 +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:
parent
f2639e528c
commit
e05d8d7061
2 changed files with 8 additions and 10 deletions
|
@ -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(
|
||||||
|
|
|
@ -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.
|
||||||
|
|
Loading…
Reference in a new issue