date_format = WPDA::get_option( WPDA::OPTION_PLUGIN_DATE_FORMAT ); $this->time_format = WPDA::get_option( WPDA::OPTION_PLUGIN_TIME_FORMAT ); // Get date and time placeholders $this->date_placeholder = WPDA::get_option( WPDA::OPTION_PLUGIN_DATE_PLACEHOLDER ); $this->time_placeholder = WPDA::get_option( WPDA::OPTION_PLUGIN_TIME_PLACEHOLDER ); switch ( $this->column_type ) { case 'time': $this->date_format = $this->time_format; $this->date_picker = 'false'; $this->time_picker = 'true'; $this->item_placeholder = $this->time_placeholder; $db_format = WPDA::DB_TIME_FORMAT; break; case 'date': $this->item_placeholder = $this->date_placeholder; $db_format = WPDA::DB_DATE_FORMAT; break; default: $this->date_format = $this->date_format . ' ' . $this->time_format; $this->time_picker = 'true'; $this->item_placeholder = $this->date_placeholder . ' ' . $this->time_placeholder; $db_format = WPDA::DB_DATETIME_FORMAT; } if ( null !== $this->item_value && '' !== $this->item_value ) { $convert_date = \DateTime::createFromFormat( $db_format, $this->item_value ); $this->item_value = $convert_date->format( $this->date_format ); } } /** * Overwrite method show_item: add date/time picker */ public function show_item() { parent::show_item(); ?>