Commit 89bb889c authored by Bryce Johnson's avatar Bryce Johnson

Stop directly parsing due_date with Date.parse, prefer parsing implicitly.

parent 052de060
...@@ -43,7 +43,7 @@ ...@@ -43,7 +43,7 @@
// Create the post date // Create the post date
value = $("input[name='" + fieldName + "']").val(); value = $("input[name='" + fieldName + "']").val();
if (value !== '') { if (value !== '') {
date = new Date(value.replace(new RegExp('-', 'g'), ',')); date = new Date(value);
mediumDate = $.datepicker.formatDate('M d, yy', date); mediumDate = $.datepicker.formatDate('M d, yy', date);
} else { } else {
mediumDate = 'No due date'; mediumDate = 'No due date';
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
$selectbox.hide(); $selectbox.hide();
} }
$value.css('display', ''); $value.css('display', '');
cssClass = Date.parse(mediumDate) ? 'bold' : 'no-value'; cssClass = new Date(mediumDate) ? 'bold' : 'no-value';
$valueContent.html("<span class='" + cssClass + "'>" + mediumDate + "</span>"); $valueContent.html("<span class='" + cssClass + "'>" + mediumDate + "</span>");
$sidebarValue.html(mediumDate); $sidebarValue.html(mediumDate);
if (value !== '') { if (value !== '') {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment