* finish 2020
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user