发布作业时的发布日期若未选择则默认为当天
This commit is contained in:
parent
b13ed0d722
commit
5e9cc27c11
|
@ -663,7 +663,7 @@ function regex_homework_end_publish_time()
|
|||
var myDate = new Date();
|
||||
if($.trim($("#homework_publish_time").val()) == "")
|
||||
{
|
||||
$("#homework_publish_time").val(myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate());
|
||||
$("#homework_publish_time").val(formate_date(myDate));
|
||||
}
|
||||
var publish_time = Date.parse($("#homework_publish_time").val());
|
||||
var end_time = Date.parse($("#homework_end_time").val());
|
||||
|
@ -695,6 +695,21 @@ function regex_homework_end_time()
|
|||
}
|
||||
}
|
||||
|
||||
function formate_date(date){
|
||||
var str = "";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var day = date.getDate();
|
||||
if(month < 10) {
|
||||
month = '0' + month;
|
||||
}
|
||||
if(day < 10) {
|
||||
day = '0' + day;
|
||||
}
|
||||
str = year + '-' + month + '-' + day;
|
||||
return str;
|
||||
}
|
||||
|
||||
//验证发送到课程
|
||||
function regex_course_id(){
|
||||
var course_id = $("#course_id").val();
|
||||
|
|
|
@ -97,7 +97,7 @@ function regex_homework_end_publish_time()
|
|||
var myDate = new Date();
|
||||
if($.trim($("#homework_publish_time").val()) == "")
|
||||
{
|
||||
$("#homework_publish_time").val(myDate.getFullYear()+'-'+(myDate.getMonth()+1)+'-'+myDate.getDate());
|
||||
$("#homework_publish_time").val(formate_date(myDate));
|
||||
}
|
||||
var end_time = Date.parse($("#homework_end_time").val());
|
||||
var publish_time = Date.parse($("#homework_publish_time").val());
|
||||
|
@ -129,6 +129,21 @@ function regex_homework_end_time()
|
|||
}
|
||||
}
|
||||
|
||||
function formate_date(date){
|
||||
var str = "";
|
||||
var year = date.getFullYear();
|
||||
var month = date.getMonth() + 1;
|
||||
var day = date.getDate();
|
||||
if(month < 10) {
|
||||
month = '0' + month;
|
||||
}
|
||||
if(day < 10) {
|
||||
day = '0' + day;
|
||||
}
|
||||
str = year + '-' + month + '-' + day;
|
||||
return str;
|
||||
}
|
||||
|
||||
//验证发送到课程
|
||||
function regex_course_id(){
|
||||
var course_id = $("#course_id").val();
|
||||
|
|
Loading…
Reference in New Issue