當前位置: 首頁>>代碼示例>>PHP>>正文


PHP TTDate::getHumanTimeSince方法代碼示例

本文整理匯總了PHP中TTDate::getHumanTimeSince方法的典型用法代碼示例。如果您正苦於以下問題:PHP TTDate::getHumanTimeSince方法的具體用法?PHP TTDate::getHumanTimeSince怎麽用?PHP TTDate::getHumanTimeSince使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在TTDate的用法示例。


在下文中一共展示了TTDate::getHumanTimeSince方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

         if (isset($user_wage_rows[$u_obj->getID()])) {
             $tmp_user_wage_rows = $user_wage_rows[$u_obj->getID()];
         } else {
             $tmp_user_wage_rows = NULL;
         }
         if (isset($user_attendance_rows[$u_obj->getID()])) {
             $tmp_user_attendance_rows = $user_attendance_rows[$u_obj->getID()];
         } else {
             $tmp_user_attendance_rows = NULL;
         }
         if (isset($user_exception_rows[$u_obj->getID()])) {
             $tmp_user_exception_rows = $user_exception_rows[$u_obj->getID()];
         } else {
             $tmp_user_exception_rows = NULL;
         }
         $row_arr = array('id' => $u_obj->getId(), 'employee_number' => $u_obj->getEmployeeNumber(), 'user_name' => $u_obj->getUserName(), 'phone_id' => $u_obj->getPhoneID(), 'ibutton_id' => $u_obj->getIButtonID(), 'full_name' => $u_obj->getFullName(TRUE), 'first_name' => $u_obj->getFirstName(), 'middle_name' => $u_obj->getMiddleName(), 'last_name' => $u_obj->getLastName(), 'title' => Option::getByKey($u_obj->getTitle(), $user_titles), 'default_branch' => Option::getByKey($u_obj->getDefaultBranch(), $branch_options), 'default_department' => Option::getByKey($u_obj->getDefaultDepartment(), $department_options), 'sex' => Option::getByKey($u_obj->getSex(), $u_obj->getOptions('sex')), 'address1' => $u_obj->getAddress1(), 'address2' => $u_obj->getAddress2(), 'city' => $u_obj->getCity(), 'province' => $u_obj->getProvince(), 'country' => $u_obj->getCountry(), 'postal_code' => $u_obj->getPostalCode(), 'work_phone' => $u_obj->getWorkPhone(), 'home_phone' => $u_obj->getHomePhone(), 'mobile_phone' => $u_obj->getMobilePhone(), 'fax_phone' => $u_obj->getFaxPhone(), 'home_email' => $u_obj->getHomeEmail(), 'work_email' => $u_obj->getWorkEmail(), 'birth_date' => $u_obj->getBirthDate(), 'birth_date_since' => $u_obj->getAge(), 'sin' => $u_obj->getSIN(), 'hire_date' => $u_obj->getHireDate(), 'hire_date_since' => TTDate::getHumanTimeSince($u_obj->getHireDate()), 'termination_date' => $u_obj->getTerminationDate(), 'user_wage_rows' => $tmp_user_wage_rows, 'user_attendance_rows' => $tmp_user_attendance_rows, 'user_exception_rows' => $tmp_user_exception_rows);
         $rows[] = $row_arr;
         unset($tmp_user_wage_rows);
     }
     $rows = Sort::Multisort($rows, Misc::trimSortPrefix($filter_data['primary_sort']), Misc::trimSortPrefix($filter_data['secondary_sort']), $filter_data['primary_sort_dir'], $filter_data['secondary_sort_dir']);
 }
 foreach ($filter_data['column_ids'] as $column_key) {
     $filter_columns[$column_key] = $columns[$column_key];
 }
 if ($action == 'export') {
     if (isset($rows) and isset($filter_columns)) {
         Debug::Text('Exporting as CSV', __FILE__, __LINE__, __METHOD__, 10);
         $data = Misc::Array2CSV($rows, $filter_columns);
         Misc::FileDownloadHeader('report.csv', 'application/csv', strlen($data));
         echo $data;
     } else {
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:31,代碼來源:UserDetail.php

示例2:

 $tmp_rows[$x]['title'] = Option::getByKey($user_obj->getTitle(), $title_options, NULL);
 $tmp_rows[$x]['group'] = Option::getByKey($user_obj->getGroup(), $group_options);
 $tmp_rows[$x]['default_branch'] = Option::getByKey($user_obj->getDefaultBranch(), $branch_options, NULL);
 $tmp_rows[$x]['default_department'] = Option::getByKey($user_obj->getDefaultDepartment(), $department_options, NULL);
 $sin_number = NULL;
 if ($permission->Check('user', 'view_sin') == TRUE) {
     $sin_number = $user_obj->getSIN();
 } else {
     $sin_number = $user_obj->getSecureSIN();
 }
 $tmp_rows[$x]['sin'] = $sin_number;
 $tmp_rows[$x]['birth_date_order'] = $user_obj->getBirthDate();
 $tmp_rows[$x]['birth_date'] = TTDate::getDate('DATE', $user_obj->getBirthDate());
 $tmp_rows[$x]['hire_date_order'] = $user_obj->getHireDate();
 $tmp_rows[$x]['hire_date'] = TTDate::getDate('DATE', $user_obj->getHireDate());
 $tmp_rows[$x]['since_hire_date'] = TTDate::getHumanTimeSince($user_obj->getHireDate());
 $tmp_rows[$x]['termination_date_order'] = $user_obj->getTerminationDate();
 $tmp_rows[$x]['termination_date'] = TTDate::getDate('DATE', $user_obj->getTerminationDate());
 if (isset($ba_obj)) {
     $tmp_rows[$x]['institution'] = $ba_obj->getInstitution();
     $tmp_rows[$x]['transit'] = $ba_obj->getTransit();
     $tmp_rows[$x]['account'] = $ba_obj->getAccount();
 } else {
     $tmp_rows[$x]['institution'] = NULL;
     $tmp_rows[$x]['transit'] = NULL;
     $tmp_rows[$x]['account'] = NULL;
 }
 $tmp_rows[$x]['currency'] = $tmp_rows[$x]['current_currency'] = Option::getByKey($raw_row['currency_id'], $currency_options);
 if ($currency_convert_to_base == TRUE) {
     $tmp_rows[$x]['current_currency'] = Option::getByKey($base_currency_obj->getId(), $currency_options);
 }
開發者ID:J-P-Hanafin,項目名稱:TimeTrex-1,代碼行數:31,代碼來源:PayStubSummary.php

示例3: columnFormatter


//.........這裏部分代碼省略.........
                     break;
                 case 'time_stamp':
                     $retval = TTDate::getDate('DATE+TIME', $value);
                     break;
                 case 'boolean':
                     if ($value == TRUE) {
                         $retval = TTi18n::getText('Yes');
                     } else {
                         $retval = TTi18n::getText('No');
                     }
                 default:
                     break;
             }
         } elseif ($format == 'xml') {
             //Use standard XML formats whenever possible.
             switch ($type) {
                 case 'report_date':
                     $column = strpos($column, 'custom_column') === FALSE ? $column : $column . '-' . 'date_stamp';
                     $retval = TTDate::getReportDates($column, $value, TRUE, $this->getUserObject());
                     break;
                 case 'currency':
                 case 'percent':
                 case 'numeric':
                     //Don't format above types.
                     break;
                 case 'time_unit':
                     $retval = TTDate::getHours($value);
                     //Force to hours always.
                     break;
                 case 'date_stamp':
                     $retval = date('Y-m-d', $value);
                     ////type="xs:date"
                     break;
                 case 'time':
                     $retval = date('H:i:s', $value);
                     //type="xs:time"
                     break;
                 case 'time_stamp':
                     $retval = date('c', $value);
                     //type="xs:dateTime"
                     break;
                 case 'boolean':
                     if ($value == TRUE) {
                         $retval = TTi18n::getText('Yes');
                     } else {
                         $retval = TTi18n::getText('No');
                     }
                 default:
                     break;
             }
         } else {
             switch ($type) {
                 case 'report_date':
                     $column = strpos($column, 'custom_column') === FALSE ? $column : $column . '-' . 'date_stamp';
                     $retval = TTDate::getReportDates($column, $value, TRUE, $this->getUserObject());
                     break;
                 case 'currency':
                     if (is_object($this->getCurrencyObject())) {
                         //Set MIN decimals to 2 and max to the currency rounding.
                         $retval = $this->getCurrencyObject()->getSymbol() . TTi18n::formatNumber($value, TRUE, 2, $this->getCurrencyObject()->getRoundDecimalPlaces());
                     } else {
                         $retval = TTi18n::formatCurrency($value);
                     }
                     break;
                 case 'percent':
                     $retval = TTi18n::formatNumber($value, TRUE) . '%';
                     break;
                 case 'numeric':
                     $retval = TTi18n::formatNumber($value, TRUE);
                     break;
                 case 'time_unit':
                     $retval = TTDate::getTimeUnit($value);
                     break;
                 case 'date_stamp':
                     $retval = TTDate::getDate('DATE', $value);
                     break;
                 case 'time':
                     $retval = TTDate::getDate('TIME', $value);
                     break;
                 case 'time_stamp':
                     $retval = TTDate::getDate('DATE+TIME', $value);
                     break;
                 case 'boolean':
                     if ($value == TRUE) {
                         $retval = TTi18n::getText('Yes');
                     } else {
                         $retval = TTi18n::getText('No');
                     }
                     break;
                 case 'time_since':
                     $retval = TTDate::getHumanTimeSince($value);
                     break;
                 default:
                     break;
             }
         }
         //Debug::Text('Column: '. $column .' Value: '. $value .' Type: '. $type .' Retval: '. $retval, __FILE__, __LINE__, __METHOD__,10);
         return $retval;
     }
 }
開發者ID:alachaum,項目名稱:timetrex,代碼行數:101,代碼來源:Report.class.php


注:本文中的TTDate::getHumanTimeSince方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。