Ejemplo n.º 1
0
 /**
  * Constructs Month
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param string first day of the week e.g. Monday (optional)
  * @access public
  */
 function Month($y, $m, $firstDay = 'Monday')
 {
     Calendar::Calendar($y, $m);
     $this->firstDay = $firstDay;
     $this->weekDayNames = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
     $this->dateMath = new DateMath($this->year, $this->month, 1, 0, 0, 0);
     $this->setFirstDay();
 }
Ejemplo n.º 2
0
 /**
  * Constructs Week
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param int week of month e.g. 3
  * @param string first day of the week e.g. Monday (optional)
  * @access public
  */
 function Week($y, $m, $w, $firstDay = 'Monday')
 {
     Calendar::Calendar($y, $m);
     $this->firstDay = $firstDay;
     $this->weekDayNames = array('Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday');
     $this->dateMath = new DateMath($this->year, $this->month, 1, 0, 0, 0);
     $this->setFirstDay();
     $this->setNumWeeks();
     if ($w < 1 || $w > $this->numWeeks) {
         trigger_error('Week::Week week ' . $w . ' is invalid');
     } else {
         $this->thisWeek = $w;
     }
 }
Ejemplo n.º 3
0
 /**
  * Constructs Calendar_Hour
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param int day e.g. 11
  * @param int hour e.g. 13
  * @access public
  */
 function Calendar_Hour($y, $m, $d, $h)
 {
     Calendar::Calendar($y, $m, $d, $h);
 }
Ejemplo n.º 4
0
 /**
  * Constructs Minute
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param int day e.g. 11
  * @param int hour e.g. 13
  * @param int minute e.g. 31
  * @access public
  */
 function Calendar_Minute($y, $m, $d, $h, $i)
 {
     Calendar::Calendar($y, $m, $d, $h, $i);
 }
Ejemplo n.º 5
0
 /**
  * Constructs Second
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param int day e.g. 11
  * @param int hour e.g. 13
  * @param int minute e.g. 31
  * @param int second e.g. 45
  */
 function Calendar_Second($y, $m, $d, $h, $i, $s)
 {
     Calendar::Calendar($y, $m, $d, $h, $i, $s);
 }
Ejemplo n.º 6
0
 /**
  * Constructs Calendar_Month
  * @param int $y year e.g. 2003
  * @param int $m month e.g. 5
  * @param int $firstDay first day of the week [optional]
  * @access public
  */
 function Calendar_Month($y, $m, $firstDay = null)
 {
     Calendar::Calendar($y, $m);
     $this->firstDay = $this->defineFirstDayOfWeek($firstDay);
 }
Ejemplo n.º 7
0
 /**
  * Constructs Calendar_Year
  *
  * @param int $y year e.g. 2003
  *
  * @access public
  */
 function Calendar_Year($y)
 {
     parent::Calendar($y);
 }
Ejemplo n.º 8
0
 /**
  * Constructs Calendar_Day
  *
  * @param int $y year e.g. 2003
  * @param int $m month e.g. 8
  * @param int $d day e.g. 15
  *
  * @access public
  */
 function Calendar_Day($y, $m, $d)
 {
     parent::Calendar($y, $m, $d);
 }
Ejemplo n.º 9
0
 /**
  * Constructs Week
  *
  * @param int $y        year e.g. 2003
  * @param int $m        month e.g. 5
  * @param int $d        a day of the desired week
  * @param int $firstDay (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
  *
  * @access public
  */
 function Calendar_Week($y, $m, $d, $firstDay = null)
 {
     include_once CALENDAR_ROOT . 'Table/Helper.php';
     Calendar::Calendar($y, $m, $d);
     $this->firstDay = $this->defineFirstDayOfWeek($firstDay);
     $this->tableHelper = new Calendar_Table_Helper($this, $this->firstDay);
     $this->thisWeek = $this->tableHelper->getWeekStart($y, $m, $d, $this->firstDay);
     $this->prevWeek = $this->tableHelper->getWeekStart($y, $m, $d - $this->cE->getDaysInWeek($this->thisYear(), $this->thisMonth(), $this->thisDay()), $this->firstDay);
     $this->nextWeek = $this->tableHelper->getWeekStart($y, $m, $d + $this->cE->getDaysInWeek($this->thisYear(), $this->thisMonth(), $this->thisDay()), $this->firstDay);
 }
Ejemplo n.º 10
0
 /**
  * Constructs Minute
  *
  * @param int $y year e.g. 2003
  * @param int $m month e.g. 5
  * @param int $d day e.g. 11
  * @param int $h hour e.g. 13
  * @param int $i minute e.g. 31
  *
  * @access public
  */
 function Calendar_Minute($y, $m, $d, $h, $i)
 {
     parent::Calendar($y, $m, $d, $h, $i);
 }
Ejemplo n.º 11
0
 /**
  * Constructs Second
  *
  * @param int $y year e.g. 2003
  * @param int $m month e.g. 5
  * @param int $d day e.g. 11
  * @param int $h hour e.g. 13
  * @param int $i minute e.g. 31
  * @param int $s second e.g. 45
  */
 function Calendar_Second($y, $m, $d, $h, $i, $s)
 {
     parent::Calendar($y, $m, $d, $h, $i, $s);
 }
Ejemplo n.º 12
0
 /**
  * Constructs Calendar_Month
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param int (optional) unused in this class
  * @access public
  */
 function Calendar_Month($y, $m, $firstDay = null)
 {
     Calendar::Calendar($y, $m);
 }
Ejemplo n.º 13
0
 /**
  * Constructs Calendar_Hour
  *
  * @param int $y year e.g. 2003
  * @param int $m month e.g. 5
  * @param int $d day e.g. 11
  * @param int $h hour e.g. 13
  *
  * @access public
  */
 function Calendar_Hour($y, $m, $d, $h)
 {
     parent::Calendar($y, $m, $d, $h);
 }
Ejemplo n.º 14
0
 /**
  * Constructs Calendar_Year
  * @param int year e.g. 2003
  * @access public
  */
 function Calendar_Year($y)
 {
     Calendar::Calendar($y);
 }
Ejemplo n.º 15
0
 /**
  * Constructs Day
  * <code>
  * $day = new Day (2003,8,15); // 15th August 2003
  * </code>
  * @param int year e.g. 2003
  * @param int month e.g. 8
  * @param int day e.g. 15
  * @access public
  */
 function Day($y, $m, $d)
 {
     Calendar::Calendar($y, $m, $d);
 }
Ejemplo n.º 16
0
 /**
  * Constructs Week
  * @param int year e.g. 2003
  * @param int month e.g. 5
  * @param int a day of the desired week
  * @param int (optional) first day of week (e.g. 0 for Sunday, 2 for Tuesday etc.)
  * @access public
  */
 function Calendar_Week($y, $m, $d, $firstDay = false)
 {
     require_once CALENDAR_ROOT . 'Table' . DIRECTORY_SEPARATOR . 'Helper.php';
     Calendar::Calendar($y, $m, $d);
     if ($firstDay !== false) {
         $this->firstDay = $firstDay;
     }
     $this->tableHelper =& new Calendar_Table_Helper($this, $firstDay);
     $this->thisWeek = $this->tableHelper->getWeekStart($y, $m, $d, $firstDay);
     $this->prevWeek = $this->tableHelper->getWeekStart($y, $m, $d - $this->cE->getDaysInWeek($this->thisYear(), $this->thisMonth(), $this->thisDay()), $firstDay);
     $this->nextWeek = $this->tableHelper->getWeekStart($y, $m, $d + $this->cE->getDaysInWeek($this->thisYear(), $this->thisMonth(), $this->thisDay()), $firstDay);
 }
Ejemplo n.º 17
0
 /**
  * Constructs Year
  * @param int year e.g. 2003
  * @access public
  */
 function Year($y)
 {
     Calendar::Calendar($y);
 }