Example #1
0
 public static function timeTillParser($w, $f, $E)
 {
     if ($f == "") {
         $f = "TodoTillTime";
     }
     $f2 = "TodoFromTime";
     if ($f == "TodoFromTime") {
         $f2 = "TodoTillTime";
     }
     $rawTime = Util::CLTimeParser($w, "store");
     $down = floor($rawTime / (15 * 60)) * 15 * 60;
     $up = ceil($rawTime / (15 * 60)) * 15 * 60;
     if (Util::CLTimeParser($down) == $w) {
         $down -= 15 * 60;
         $up += 15 * 60;
     }
     $I = new HTMLInput($f, "time", $w);
     $I->style("width:50px;text-align:right;");
     $I->id($f);
     if ($f == "TodoFromTime") {
         $I->connectTo("TodoTillTime");
     }
     $values = array($down - 900 * 2, $down - 900, $down, $up, $up + 900);
     if ($f == "TodoFromTime") {
         $values = array($down, $up, $up + 900, $up + 900 * 2, $up + 900 * 3);
     }
     /*$T = new HTMLTable(count($values));
     		$T->setTableStyle("margin-top:5px;display:none;");
     		$val = array_map("Util::CLTimeParser", $values);
     		$T->addRow($val);
     		$T->setTableID("{$f}Table");
     
     		for($i = 1; $i < 6; $i++){
     			#$T->setColClass($i, "");
     			
     			$T->setColWidth($i, (100 / count($values))."%");
     			$T->addCellStyle($i, "cursor:pointer;text-align:center;color:grey;");
     			$T->addCellEvent($i, "mouseover", "this.className = 'backgroundColor0';");
     			$T->addCellEvent($i, "mouseout", "this.className = '';");
     			
     			$T->addCellEvent($i, "click", "$('$f').value = '".Util::CLTimeParser($values[$i-1])."'; ".($f == "TodoFromTime" ? "$('$f2').value = '".Util::CLTimeParser($values[$i-1] + 3600)."';" : ""));
     		}*/
     return "<span id=\"{$f}Display\" style=\"" . ($E->A("TodoAllDay") ? "display:none;" : "") . "\" ><span style=\"color:grey;margin-left:30px;\">um</span> " . $I . "</span>";
     #.($w != "" ? $T : "")
 }