Page MenuHomePhabricator

D15727.id37994.diff
No OneTemporary

D15727.id37994.diff

diff --git a/resources/celerity/map.php b/resources/celerity/map.php
--- a/resources/celerity/map.php
+++ b/resources/celerity/map.php
@@ -479,7 +479,7 @@
'rsrc/js/core/behavior-device.js' => 'b5b36110',
'rsrc/js/core/behavior-drag-and-drop-textarea.js' => '4f6a4b4e',
'rsrc/js/core/behavior-error-log.js' => '6882e80a',
- 'rsrc/js/core/behavior-fancy-datepicker.js' => '8ae55229',
+ 'rsrc/js/core/behavior-fancy-datepicker.js' => '568931f3',
'rsrc/js/core/behavior-file-tree.js' => '88236f00',
'rsrc/js/core/behavior-form.js' => '5c54cbf3',
'rsrc/js/core/behavior-gesture.js' => '3ab51e2c',
@@ -622,7 +622,7 @@
'javelin-behavior-editengine-reorder-fields' => 'b59e1e96',
'javelin-behavior-error-log' => '6882e80a',
'javelin-behavior-event-all-day' => '38dcf3c8',
- 'javelin-behavior-fancy-datepicker' => '8ae55229',
+ 'javelin-behavior-fancy-datepicker' => '568931f3',
'javelin-behavior-global-drag-and-drop' => 'c8e57404',
'javelin-behavior-herald-rule-editor' => '7ebaeed3',
'javelin-behavior-high-security-warning' => 'a464fe03',
@@ -1301,6 +1301,13 @@
'phabricator-drag-and-drop-file-upload',
'javelin-workboard-board',
),
+ '568931f3' => array(
+ 'javelin-behavior',
+ 'javelin-util',
+ 'javelin-dom',
+ 'javelin-stratcom',
+ 'javelin-vector',
+ ),
'56a1ca03' => array(
'javelin-behavior',
'javelin-behavior-device',
@@ -1554,13 +1561,6 @@
'javelin-install',
'javelin-dom',
),
- '8ae55229' => array(
- 'javelin-behavior',
- 'javelin-util',
- 'javelin-dom',
- 'javelin-stratcom',
- 'javelin-vector',
- ),
'8bdb2835' => array(
'phui-fontkit-css',
),
diff --git a/webroot/rsrc/js/core/behavior-fancy-datepicker.js b/webroot/rsrc/js/core/behavior-fancy-datepicker.js
--- a/webroot/rsrc/js/core/behavior-fancy-datepicker.js
+++ b/webroot/rsrc/js/core/behavior-fancy-datepicker.js
@@ -264,6 +264,7 @@
function getValidDate() {
var written_date = new Date(value_y, value_m-1, value_d);
+
if (isNaN(written_date.getTime())) {
return new Date();
} else {
@@ -272,6 +273,14 @@
value_y += 2000;
written_date = new Date(value_y, value_m-1, value_d);
}
+
+ // adjust for a date like February 31
+ var adjust = 1;
+ while (written_date.getMonth() !== value_m-1) {
+ written_date = new Date(value_y, value_m-1, value_d-adjust);
+ adjust++;
+ }
+
return written_date;
}
}

File Metadata

Mime Type
text/plain
Expires
Thu, Oct 31, 12:01 PM (2 w, 4 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6723307
Default Alt Text
D15727.id37994.diff (2 KB)

Event Timeline