Beispiel #1
0
 public function render()
 {
     $args = $this->parse_args('text_date', array('class' => 'cmb2-text-small cmb2-datepicker', 'value' => $this->field->get_timestamp_format(), 'desc' => $this->_desc(), 'js_dependencies' => array('jquery-ui-core', 'jquery-ui-datepicker')));
     if (false === strpos($args['class'], 'timepicker')) {
         $this->parse_picker_options('date');
     }
     return parent::render($args);
 }
 public function render()
 {
     $field = $this->field;
     $args = wp_parse_args($this->args, array('value' => $field->escaped_value(), 'desc' => $this->_desc(), 'datepicker' => array(), 'timepicker' => array()));
     if (empty($args['value'])) {
         $args['value'] = $field->escaped_value();
         // This will be used if there is a select_timezone set for this field
         $tz_offset = $field->field_timezone_offset();
         if (!empty($tz_offset)) {
             $args['value'] -= $tz_offset;
         }
     }
     $has_good_value = !empty($args['value']) && !is_array($args['value']);
     $date_input = parent::render($this->date_args($args, $has_good_value));
     $time_input = parent::render($this->time_args($args, $has_good_value));
     return $this->rendered($date_input . "\n" . $time_input);
 }