默认发布日期的格式

This commit is contained in:
cxt 2015-11-05 15:45:21 +08:00
parent 019e4e0630
commit 9be1fe63b4
2 changed files with 2 additions and 2 deletions

View File

@ -663,7 +663,7 @@ function regex_homework_end_publish_time()
var myDate = new Date(); var myDate = new Date();
if($.trim($("#homework_publish_time").val()) == "") if($.trim($("#homework_publish_time").val()) == "")
{ {
$("#homework_publish_time").val(myDate.toLocaleDateString()); $("#homework_publish_time").val(myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate());
} }
var publish_time = Date.parse($("#homework_publish_time").val()); var publish_time = Date.parse($("#homework_publish_time").val());
var end_time = Date.parse($("#homework_end_time").val()); var end_time = Date.parse($("#homework_end_time").val());

View File

@ -97,7 +97,7 @@ function regex_homework_end_publish_time()
var myDate = new Date(); var myDate = new Date();
if($.trim($("#homework_publish_time").val()) == "") if($.trim($("#homework_publish_time").val()) == "")
{ {
$("#homework_publish_time").val(myDate.toLocaleDateString()); $("#homework_publish_time").val(myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate());
} }
var end_time = Date.parse($("#homework_end_time").val()); var end_time = Date.parse($("#homework_end_time").val());
var publish_time = Date.parse($("#homework_publish_time").val()); var publish_time = Date.parse($("#homework_publish_time").val());