Changeset 1364
- Timestamp:
- 12/29/11 14:43:18 (18 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
framework/branches/2.0/includes/qcubed/_core/base_controls/QDatepickerBoxBase.class.php
r1295 r1364 1 1 <?php 2 /** 2 3 /** 3 4 * @property string $DateFormat 4 5 * @property string $DateTimeFormat … … 8 9 * 9 10 */ 10 class QDatepickerBoxBase extends QDatepickerBoxGen 11 {12 protected $strDateTimeFormat = "MM/DD/YY"; // matches default of JQuery UI control11 class QDatepickerBoxBase extends QDatepickerBoxGen { 12 protected $strDateTimeFormat = "MM/DD/YY"; // matches default of JQuery UI control 13 /** @var QDateTime */ 13 14 protected $dttDateTime; 14 15 15 public function ParsePostData() { 16 // Check to see if this Control's Value was passed in via the POST data 17 if (array_key_exists($this->strControlId, $_POST)) { 18 parent::ParsePostData(); 19 $this->dttDateTime = new QDateTime($this->strText); 20 } 21 } 16 public function ParsePostData() { 17 // Check to see if this Control's Value was passed in via the POST data 18 if (array_key_exists($this->strControlId, $_POST)) { 19 parent::ParsePostData(); 20 $this->dttDateTime = new QDateTime($this->strText); 21 if ($this->dttDateTime->IsNull()) { 22 $this->dttDateTime = null; 23 } 24 } 25 } 22 26 23 27 public function Validate() { … … 57 61 switch ($strName) { 58 62 // MISC 59 case "Maximum": return $this->MaxDate; 60 case "Minimum": return $this->MinDate; 63 case "Maximum": 64 return $this->MaxDate; 65 case "Minimum": 66 return $this->MinDate; 61 67 case 'DateTimeFormat': 62 case 'DateFormat': return $this->strDateTimeFormat; 63 case 'DateTime': return $this->dttDateTime; 68 case 'DateFormat': 69 return $this->strDateTimeFormat; 70 case 'DateTime': 71 return $this->dttDateTime; 64 72 65 73 default: … … 72 80 } 73 81 } 82 74 83 ///////////////////////// 75 84 // Public Properties: SET … … 98 107 try { 99 108 $this->dttDateTime = QType::Cast($mixValue, QType::DateTime); 109 if ($this->dttDateTime->IsNull()) { 110 $this->dttDateTime = null; 111 } 100 112 if (!$this->dttDateTime || !$this->strDateTimeFormat) { 101 113 parent::__set('Text', ''); … … 150 162 } 151 163 } 164 152 165 ?>
