CC-3671: add show on week/day view doesn't get start time/end time filled in

- fixed
- moved pad function into common.js
This commit is contained in:
James 2012-04-25 16:04:36 -04:00
parent 140c8d55ae
commit 5c401cb472
3 changed files with 11 additions and 31 deletions

View File

@ -82,4 +82,13 @@ function openPreviewWindow(url) {
//var elemID = "spl_"+elemIndexString;
//$('#'+elemID+' div.list-item-container a span').attr("class", "ui-icon ui-icon-pause");
return false;
}
function pad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}

View File

@ -447,15 +447,6 @@ function setAddShowEvents() {
}
$('#add_show_duration').val(duration);
}
function pad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
}
function showErrorSections() {

View File

@ -58,17 +58,6 @@ function removeAddShowButton(){
span.remove();
}
function pad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
function makeTimeStamp(date){
var sy, sm, sd, h, m, s, timestamp;
sy = date.getFullYear();
@ -82,15 +71,6 @@ function makeTimeStamp(date){
return timestamp;
}
function pad(number, length) {
var str = '' + number;
while (str.length < length) {
str = '0' + str;
}
return str;
}
function dayClick(date, allDay, jsEvent, view){
// The show from will be preloaded if the user is admin or program manager.
// Hence, if the user if DJ then it won't open anything.
@ -141,7 +121,7 @@ function dayClick(date, allDay, jsEvent, view){
}else{
// if in day or week view, selected has all the time info as well
// so we don't ahve to calculate it explicitly
startTime_string = selected.getHours()+":"+selected.getMinutes()
startTime_string = pad(selected.getHours(),2)+":"+pad(selected.getMinutes(),2)
startTime = 0
}
@ -155,7 +135,7 @@ function dayClick(date, allDay, jsEvent, view){
$("#add_show_end_date_no_repeat").val(endDateFormat);
$("#add_show_end_date").val(endDateFormat);
if(view.name !== "month") {
var endTimeString = endDateTime.getHours()+":"+endDateTime.getMinutes();
var endTimeString = pad(endDateTime.getHours(),2)+":"+pad(endDateTime.getMinutes(),2);
$("#add_show_start_time").val(startTime_string)
$("#add_show_end_time").val(endTimeString)
}