* finish 2020

This commit is contained in:
chujilu
2014-08-15 15:59:35 +08:00
parent 56737be238
commit 2e344f2e0d
4 changed files with 55 additions and 2 deletions
+33
View File
@@ -25,3 +25,36 @@ function loadProjectBuilds(projectID)
$('#buildBox').load(link);
}
/**
* Convert a date string like 2011-11-11 to date object in js.
*
* @param string $date
* @access public
* @return date
*/
function convertStringToDate(dateString)
{
dateString = dateString.split('-');
dateString = dateString[1] + '/' + dateString[2] + '/' + dateString[0];
return Date.parse(dateString);
}
/**
* when begin date input change and end date input is null
* change end date input to begin's after day
*
* @access public
* @return void
*/
function suitEndDate()
{
beginDate = $('#begin').val();
if(!beginDate) return;
endDate = $('#end').val();
if(endDate) return;
endDate = convertStringToDate(beginDate).addDays(1);
endDate = endDate.toString('yyyy-M-dd');
$('#end').val(endDate);
}