Time column with interval
-
Hi!
I want to suggest one option to implement. It’s better for me view interval in time-column. Like this “11:00 – 11:30”.
For this iI have changed function “mptt_make_data_shortcode”
/** * Make data shortcode * * @param $bounds * @param $mptt_shortcode_data * @param $column_events * * @return array */ function mptt_make_data_shortcode( $bounds, $mptt_shortcode_data, $column_events ) { $data = array( 'rows' => array() ); $amount_rows = 23 / $mptt_shortcode_data[ 'params' ][ 'increment' ]; $data[ 'table_header' ] = mptt_get_header_row( $mptt_shortcode_data ); foreach ( $column_events as $column_id => $events_list ) { foreach ( $events_list as $event_key => $item ) { if ( isset( $item->resolve ) ) { unset( $item->resolve ); } } } for ( $row_index = $bounds[ 'start' ]; $row_index <= $bounds[ 'end' ]; $row_index ++ ) { $table_time_cell = get_time_cell( $row_index, $amount_rows, $mptt_shortcode_data[ 'params' ][ 'increment' ] ); <span style="text-decoration: underline;">$table_time_cell_end = get_time_cell( $row_index+1, $amount_rows, $mptt_shortcode_data[ 'params' ][ 'increment' ] );</span> list( $row_cells, $column_events ) = mptt_get_row_events( $column_events, $row_index ); if ( $mptt_shortcode_data[ 'params' ][ 'group' ] ) { $row_cells = mptt_group_identical_row_events( $row_cells ); } $data[ 'rows' ][ $row_index ][ 'cells' ] = $row_cells; $data[ 'rows' ][ $row_index ][ 'show' ] = mptt_shortcode_row_has_items( $row_index, $column_events ); if ( ! $mptt_shortcode_data[ 'params' ][ 'hide_hrs' ] ) { array_unshift( $data[ 'rows' ][ $row_index ][ 'cells' ], array( 'time_cell' => true, 'title' => date( get_option( 'time_format' ), strtotime( $table_time_cell ) )<span style="text-decoration: underline;"> . ' - ' . date( get_option( 'time_format' ), strtotime( $table_time_cell_end ) ) ) )</span>; } } return $data; }
Sorry for my English ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Time column with interval’ is closed to new replies.