CC-2289:differentiate-between-time-and-duration
- some change in date populating rules - change on start date/time triggers change in end date/time - change on end date/time will triggers background turning into red color to notify user that end date/time is earlier than start date/time. - need to do more work once I get img file from Vladmir
This commit is contained in:
parent
1dabbacca2
commit
6a15f51aac
4 changed files with 127 additions and 4 deletions
|
@ -104,6 +104,9 @@ class Application_Form_AddShowWhen extends Zend_Form_SubForm
|
|||
}elseif(strpos($formData["add_show_duration"], 'h') !== false && intval(substr($formData["add_show_duration"], 0, strpos($formData["add_show_duration"], 'h'))) > 23) {
|
||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration > 24h'));
|
||||
$valid = false;
|
||||
}elseif( strstr($formData["add_show_duration"], '-') ){
|
||||
$this->getElement('add_show_duration')->setErrors(array('Cannot have duration < 0m'));
|
||||
$valid = false;
|
||||
}
|
||||
|
||||
return $valid;
|
||||
|
|
|
@ -28,7 +28,30 @@ class Application_Model_Nowplaying
|
|||
//format duration
|
||||
$duration = explode('.', $dbRow['clip_length']);
|
||||
$duration = explode(':', $duration[0]);
|
||||
$duration = $duration[0].'h'.$duration[1].'m'.$duration[2].'s';
|
||||
|
||||
if($duration[2] == 0){
|
||||
$duration[2] = '';
|
||||
}else{
|
||||
$duration[2] = intval($duration[2],10).'s';
|
||||
}
|
||||
|
||||
if($duration[1] == 0){
|
||||
if($duration[2] == ''){
|
||||
$duration[1] = '';
|
||||
}else{
|
||||
$duration[1] = intval($duration[1],10).'m';
|
||||
}
|
||||
}else{
|
||||
$duration[1] = intval($duration[1],10).'m';
|
||||
}
|
||||
|
||||
if($duration[0] == 0){
|
||||
$duration[0] = '';
|
||||
}else{
|
||||
$duration[0] = intval($duration[0],10).'h';
|
||||
}
|
||||
|
||||
$duration = $duration[0].$duration[1].$duration[2];
|
||||
|
||||
$dataTablesRows[] = array($type, $dbRow['show_starts'], $itemStart[0], $itemEnd[0],
|
||||
$duration, $dbRow['track_title'], $dbRow['artist_name'], $dbRow['album_title'],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue