diff --git a/resources/celerity/map.php b/resources/celerity/map.php index 309e698272..01ad9da370 100644 --- a/resources/celerity/map.php +++ b/resources/celerity/map.php @@ -481,7 +481,7 @@ return array( 'rsrc/js/core/behavior-detect-timezone.js' => '78bc5d94', 'rsrc/js/core/behavior-device.js' => 'ac2b1e01', 'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '7ad020a5', - 'rsrc/js/core/behavior-fancy-datepicker.js' => '956f3eeb', + 'rsrc/js/core/behavior-fancy-datepicker.js' => '36821f8d', 'rsrc/js/core/behavior-form.js' => '55d7b788', 'rsrc/js/core/behavior-gesture.js' => 'b58d1a2a', 'rsrc/js/core/behavior-global-drag-and-drop.js' => '1cab0e9a', @@ -635,7 +635,7 @@ return array( 'javelin-behavior-editengine-reorder-configs' => '4842f137', 'javelin-behavior-editengine-reorder-fields' => '0ad8d31f', 'javelin-behavior-event-all-day' => '0b1bc990', - 'javelin-behavior-fancy-datepicker' => '956f3eeb', + 'javelin-behavior-fancy-datepicker' => '36821f8d', 'javelin-behavior-global-drag-and-drop' => '1cab0e9a', 'javelin-behavior-harbormaster-log' => 'b347a301', 'javelin-behavior-herald-rule-editor' => '0922e81d', @@ -1229,6 +1229,13 @@ return array( 'aphront-typeahead-control-css', 'phui-tag-view-css', ), + '36821f8d' => array( + 'javelin-behavior', + 'javelin-util', + 'javelin-dom', + 'javelin-stratcom', + 'javelin-vector', + ), '3829a3cf' => array( 'javelin-behavior', 'javelin-uri', @@ -1781,13 +1788,6 @@ return array( 'javelin-vector', 'javelin-stratcom', ), - '956f3eeb' => array( - 'javelin-behavior', - 'javelin-util', - 'javelin-dom', - 'javelin-stratcom', - 'javelin-vector', - ), '9623adc1' => array( 'javelin-behavior', 'javelin-stratcom', diff --git a/webroot/rsrc/js/core/behavior-fancy-datepicker.js b/webroot/rsrc/js/core/behavior-fancy-datepicker.js index afd5ff25ad..8059e214fe 100644 --- a/webroot/rsrc/js/core/behavior-fancy-datepicker.js +++ b/webroot/rsrc/js/core/behavior-fancy-datepicker.js @@ -424,6 +424,13 @@ JX.behavior('fancy-datepicker', function(config, statics) { value_m += 12; value_y--; } + // This relies on months greater than 11 rolling over into the next + // year and days less than 1 rolling back into the previous month. + var last_date = new Date(value_y, value_m, 0); + if (value_d > last_date.getDate()) { + // The date falls outside the new month, so stuff it back in. + value_d = last_date.getDate(); + } break; case 'd': // User clicked a day.