Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function validateUserValue($values)
 {
     if ($this->_dateExists() || $this->_timeExists()) {
         return parent::validateUserValue($this->formatValues($values));
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Time (hh:mm am/pm) html drop-downs
  *
  * @return string Formatted Html
  */
 public function getTimeHtml()
 {
     if ($this->_catalogProductOptionTypeDate->is24hTimeFormat()) {
         $hourStart = 0;
         $hourEnd = 23;
         $dayPartHtml = '';
     } else {
         $hourStart = 1;
         $hourEnd = 12;
         $dayPartHtml = $this->_getHtmlSelect('day_part')->setOptions(array('am' => __('AM'), 'pm' => __('PM')))->getHtml();
     }
     $hoursHtml = $this->_getSelectFromToHtml('hour', $hourStart, $hourEnd);
     $minutesHtml = $this->_getSelectFromToHtml('minute', 0, 59);
     return $hoursHtml . '&nbsp;<b>:</b>&nbsp;' . $minutesHtml . '&nbsp;' . $dayPartHtml;
 }