$cobj->time_allow1 = $time_allow1; $cobj->time_allow2 = $time_allow2; $cobj->setYearInterval($year_start, $year_end); $cobj->setTimezone($timezone); //set for further usage, nothing for now $theme_path = $theme != "" ? $cobj->getThemePath($theme) : ""; if (!is_file($theme_path)) { $theme_path = ""; } //check and show default calendar month and year on valid range of date_allow if (!isset($_REQUEST["m"])) { if ($time_allow1 != "") { //get date of time allow1 if ($cdate->validDate($time_allow1)) { //check valid if today is after date_allow1 if (!$cdate->dateAfter($time_allow1, $today)) { //reset default calendar display $y = $cdate->getDate('Y', $time_allow1); $m = $cdate->getDate('m', $time_allow1); } } } } $year_start = $cobj->year_start; $year_end = $cobj->year_end; //check year display in valid range if ($y >= $year_end) { $y = $year_end; } if ($y <= $year_start) { $y = $year_start;
$objname = isset($_REQUEST["objname"]) ? $_REQUEST["objname"] : ""; $dp = isset($_REQUEST["dp"]) ? $_REQUEST["dp"] : ""; $cobj = new tc_calendar(""); $cobj->setDate($sld, $slm, $sly); $cobj->startDate($startDate); $cobj->dsb_days = explode(",", $dsb_txt); $cobj->time_allow1 = $time_allow1; $cobj->time_allow2 = $time_allow2; $cobj->setYearInterval($year_start, $year_end); //check and show default calendar month and year on valid range of date_allow if (!isset($_REQUEST["m"])) { if ($time_allow1 > 0) { //get date of time allow1 $date_allow1 = $cdate->getDateFromTimestamp($time_allow1); //check valid if today is after date_allow1 if (!$cdate->dateAfter($date_allow1, $today)) { //reset default calendar display $y = $cdate->getDateFromTimestamp($time_allow1, 'Y'); $m = $cdate->getDateFromTimestamp($time_allow1, 'm'); } } } $year_start = $cobj->year_start; $year_end = $cobj->year_end; //check year display in valid range if ($y >= $year_end) { $y = $year_end; } if ($y <= $year_start) { $y = $year_start; }