public function list_items($limit = null, $offset = null, $col = 'start_date', $order = 'desc', $just_count = FALSE) { $this->db->select('events.id, events.name, start_date, end_date, events.published', FALSE); $data = parent::list_items($limit, $offset, $col, $order, $just_count); if (!$just_count) { foreach ($data as $key => $val) { $data[$key]['start_date'] = date_formatter($val['start_date'], 'm/d/Y g:ia'); $data[$key]['end_date'] = date_formatter($val['start_date'], 'm/d/Y g:ia'); } } return $data; }
public function list_items($limit = null, $offset = null, $col = 'name', $order = 'asc', $just_count = FALSE) { $this->db->select('news.id, news.title, news.publish_date, news.published', FALSE); $data = parent::list_items($limit, $offset, $col, $order); if (!$just_count) { foreach ($data as $key => $val) { // format with PHP instead of MySQL so that ordering will still work with MySQL if (!empty($val['publish_date'])) { $data[$key]['publish_date'] = date_formatter($val['publish_date'], 'm/d/Y h:ia'); } } } return $data; }
/** * @dataProvider dateFormatterData */ public function test_date_formatter($input, $expected) { $this->assertSame($expected, date_formatter($input)); }
"> <div class="b2_title"> <!-- <img src='<?php echo site_url() . 'assets/' . $event->spilt_file; ?> '> --> <div class="b2_title1"><?php echo $event->title; ?> </div> <div class="b2_title2"><?php echo date_formatter($event->start_date); ?> -<?php echo date_formatter($event->deadline); ?> </div> </div> </div> <div id="vote2"> <div id="vote_title"> <div class="main_width"> <div class="vote_title">請登錄後,點選<span class=" fa fa-heart"></span>投票</div> </div> </div> <div id="vote_top" class="main_width"> <span class="vote_search"> <input type="input" class="search_box" id="search_box" placeholder="Search" value="<?php echo $keyword;