Stop directly parsing due_date with Date.parse, prefer parsing implicitly.
This commit is contained in:
parent
052de0600c
commit
89bb889c45
1 changed files with 2 additions and 2 deletions
|
@ -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 @@
|
||||||
$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 !== '') {
|
||||||
|
|
Loading…
Reference in a new issue