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


PHP LocaleUtil類代碼示例

本文整理匯總了PHP中LocaleUtil的典型用法代碼示例。如果您正苦於以下問題:PHP LocaleUtil類的具體用法?PHP LocaleUtil怎麽用?PHP LocaleUtil使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: getCreatedAtLocalized

 public function getCreatedAtLocalized($sFormat = ' %e. %B %Y')
 {
     if (Session::language() === 'en') {
         $sFormat = ' %e %B %Y';
     }
     return LocaleUtil::localizeDate($this->created_at, null, $sFormat);
 }
開發者ID:rapila,項目名稱:plugin-journal,代碼行數:7,代碼來源:JournalComment.php

示例2: parseAddData

 public function parseAddData($postArr, $admin = false)
 {
     // Extract dates
     $postArr['txtLeaveFromDate'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtLeaveFromDate']);
     $postArr['txtLeaveToDate'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtLeaveToDate']);
     // Extract time
     $postArr['sltLeaveFromTime'] = LocaleUtil::getInstance()->convertToStandardTimeFormat($postArr['sltLeaveFromTime']);
     $postArr['sltLeaveToTime'] = LocaleUtil::getInstance()->convertToStandardTimeFormat($postArr['sltLeaveToTime']);
     if ($admin) {
         $this->parent_Leave->setEmployeeId($postArr['cmbEmployeeId']);
     } else {
         $this->parent_Leave->setEmployeeId($_SESSION['empID']);
     }
     $this->parent_Leave->setLeaveTypeId($postArr['sltLeaveType']);
     $this->parent_Leave->setLeaveFromDate($postArr['txtLeaveFromDate']);
     if (isset($postArr['txtLeaveToDate']) && !empty($postArr['txtLeaveToDate'])) {
         $this->parent_Leave->setLeaveToDate($postArr['txtLeaveToDate']);
     } else {
         $this->parent_Leave->setLeaveToDate($postArr['txtLeaveFromDate']);
     }
     if ($this->parent_Leave->getLeaveFromDate() == $this->parent_Leave->getLeaveToDate() && $this->parent_Leave->getLeaveFromDate() != null) {
         $lengthHours = $postArr['txtLeaveTotalTime'];
         if (!empty($postArr['sltLeaveFromTime']) && !empty($postArr['sltLeaveToTime'])) {
             $this->parent_Leave->setStartTime($postArr['sltLeaveFromTime']);
             $this->parent_Leave->setEndTime($postArr['sltLeaveToTime']);
         }
         $this->parent_Leave->setLeaveLengthHours($lengthHours);
     } else {
         $lengthDays = 1;
         $this->parent_Leave->setLeaveLengthDays($lengthDays);
     }
     $this->parent_Leave->setLeaveComments($postArr['txtComments']);
     return $this->parent_Leave;
 }
開發者ID:googlecode-mirror,項目名稱:pucit-orangehrm,代碼行數:34,代碼來源:EXTRACTOR_LeaveRequests.php

示例3: getValue

 public function getValue($row, $ddList)
 {
     $value = "";
     switch ($this->type) {
         case self::FIELD_TYPE_DIRECT:
             if (isset($row[$this->name])) {
                 $valueFromDb = $row[$this->name];
                 $value = CSVField::escape($valueFromDb);
             }
             break;
         case self::FIELD_TYPE_DATE:
             if (isset($row[$this->name])) {
                 $valueFromDb = $row[$this->name];
                 $value = CSVField::escape(LocaleUtil::getInstance()->formatDate($valueFromDb));
             }
             break;
         case self::FIELD_TYPE_FROMMAP:
             if (isset($row[$this->name])) {
                 $valueFromDb = $row[$this->name];
                 $value = CSVField::escape(CSVField::getValueFromMap($this->map, $valueFromDb));
             }
             break;
         case self::FIELD_TYPE_DIRECT_DEBIT:
             $value = CSVField::escape($this->_getDDValue($row, $ddList));
             break;
     }
     return $value;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:28,代碼來源:CSVField.php

示例4: send

 /** send()
  * Description:
  * • This method is called when NewsletterMailer is instanciated
  * • All newsletter, sender and recipient info are ready
  *
  * @return boolean has_invalid email addresses
  */
 public function send()
 {
     // Get newsletter email main template and template body and css by template name
     $oEmailTemplate = new Template('main', array(DIRNAME_TEMPLATES, 'newsletter'));
     $oEmailTemplate->replaceIdentifier('newsletter_template_css', new Template("{$this->oNewsletter->getTemplateName()}.css", array(DIRNAME_TEMPLATES, 'newsletter')));
     // Parse links differently in text
     RichtextUtil::$USE_ABSOLUTE_LINKS = LinkUtil::isSSL();
     $oEMailContent = RichtextUtil::parseStorageForFrontendOutput(stream_get_contents($this->oNewsletter->getNewsletterBody()));
     RichtextUtil::$USE_ABSOLUTE_LINKS = null;
     // Replace add surrounding (body.tmpl) before content if exists. Template needs to contain a newsletter_content identifier
     if (ResourceFinder::findResource(array(DIRNAME_TEMPLATES, NewsletterDetailWidgetModule::NEWSLETTER_DIRNAME, "{$this->oNewsletter->getTemplateName()}.body.tmpl")) !== null) {
         $oEmailTemplate->replaceIdentifier('newsletter_content', new Template("{$this->oNewsletter->getTemplateName()}.body", array(DIRNAME_TEMPLATES, NewsletterDetailWidgetModule::NEWSLETTER_DIRNAME)), null, Template::LEAVE_IDENTIFIERS);
     }
     $oEmailTemplate->replaceIdentifier('newsletter_content', $oEMailContent, null, Template::LEAVE_IDENTIFIERS);
     $oEmailTemplate->replaceIdentifier('subject', $this->oNewsletter->getSubject());
     $oEmailTemplate->replaceIdentifier('language', $this->oNewsletter->getLanguageId());
     $oEmailTemplate->replaceIdentifier('newsletter_link', LinkUtil::absoluteLink($this->oNewsletter->getDisplayLink()));
     $oEmailTemplate->replaceIdentifier('newsletter_date', LocaleUtil::localizeDate(null, $this->oNewsletter->getLanguageId()));
     $oEmailTemplate->replaceIdentifier('newsletter_timestamp', time());
     // Process templates with each recipient, depending on whether recipient is object and object of Subscriber or string
     foreach ($this->aRecipients as $mRecipient) {
         $this->sendNewsletter($mRecipient, clone $oEmailTemplate);
     }
     return count($this->aInvalidEmails) === 0;
 }
開發者ID:rapila,項目名稱:plugin-newsletter,代碼行數:32,代碼來源:NewsletterMailer.php

示例5: getLastSentLocalized

 public function getLastSentLocalized($sFormat = 'x')
 {
     if ($this->getLastSent() != null) {
         return LocaleUtil::localizeDate($this->getLastSent(), null, $sFormat);
     }
     return null;
 }
開發者ID:rapila,項目名稱:plugin-newsletter,代碼行數:7,代碼來源:Newsletter.php

示例6: getPublishAtFormatted

 public function getPublishAtFormatted($sLanguageId = null, $sFormatString = 'x')
 {
     if ($this->publish_at === null) {
         return null;
     }
     return LocaleUtil::localizeDate($this->publish_at, $sLanguageId, $sFormatString);
 }
開發者ID:rapila,項目名稱:plugin-journal,代碼行數:7,代碼來源:JournalEntry.php

示例7: getDateSentFormatted

 public function getDateSentFormatted($sAddTimeFormat = null)
 {
     $sTime = LocaleUtil::localizeDate($this->date_sent);
     if ($sAddTimeFormat) {
         $sTime .= ' ' . $this->getDateSent($sAddTimeFormat);
     }
     return $sTime;
 }
開發者ID:rapila,項目名稱:plugin-newsletter,代碼行數:8,代碼來源:NewsletterMailing.php

示例8: reloadData

 public function reloadData($postArr)
 {
     $postArr['ChiDOB'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['ChiDOB']);
     $this->txtEmpID = $postArr['txtEmpID'];
     $this->txtDSeqNo = trim($postArr['txtDSeqNo']);
     $this->txtChiName = trim($postArr['txtChiName']);
     $this->DOB = self::_handleEmptyDates($postArr['ChiDOB']);
     return $this;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:9,代碼來源:EXTRACTOR_EmpChildren.php

示例9: parseViewDataWithTimezoneDiff

 public function parseViewDataWithTimezoneDiff($clientStartDate, $clientEndDate, $timesheetPeriodId)
 {
     $this->parent_Timesheet = new Timesheet();
     $this->parent_Timesheet->setStartDate(LocaleUtil::getInstance()->convertToStandardDateFormat($clientStartDate));
     $this->parent_Timesheet->setEndDate(LocaleUtil::getInstance()->convertToStandardDateFormat($clientEndDate) . " 23:59:59");
     $this->parent_Timesheet->setTimesheetPeriodId($timesheetPeriodId);
     $this->parent_Timesheet->setEmployeeId($_SESSION['empID']);
     return $this->parent_Timesheet;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:9,代碼來源:EXTRACTOR_Timesheet.php

示例10: parseData

 public function parseData($postArr)
 {
     $postArr['txtEmpLicDat'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpLicDat']);
     $postArr['txtEmpreDat'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpreDat']);
     $this->emplicen->setEmpId(trim($postArr['txtEmpID']));
     $this->emplicen->setEmpLicCode(trim($postArr['cmbLicCode']));
     $this->emplicen->setEmpLicDat(self::_handleEmptyDates($postArr['txtEmpLicDat']));
     $this->emplicen->setEmpLicrenewalDat(self::_handleEmptyDates($postArr['txtEmpreDat']));
     return $this->emplicen;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:10,代碼來源:EXTRACTOR_EmpLicenses.php

示例11: parseData

 function parseData($postArr)
 {
     $postArr['txtEmpConExtStartDat'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpConExtStartDat']);
     $postArr['txtEmpConExtEndDat'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpConExtEndDat']);
     $this->empconext->setEmpId(trim($postArr['txtEmpID']));
     $this->empconext->setEmpConExtId(trim($postArr['txtEmpConExtID']));
     $this->empconext->setEmpConExtStartDat(trim($postArr['txtEmpConExtStartDat']));
     $this->empconext->setEmpConExtEndDat(trim($postArr['txtEmpConExtEndDat']));
     return $this->empconext;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:10,代碼來源:EXTRACTOR_EmpConExt.php

示例12: parseEditData

 public static function parseEditData($postArr)
 {
     $payPeriod = new HspPayPeriod();
     $payPeriod->setId($postArr['txtPayPeriodId']);
     $payPeriod->setStartDate(LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtPayPeriodFromDate']));
     $payPeriod->setEndDate(LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtPayPeriodToDate']));
     $payPeriod->setCloseDate(LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtPayPeriodCloseDate']));
     $payPeriod->setTimesheetAprovalDueDate(LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtPayPeriodTimesheetDueDate']));
     $payPeriod->setCheckDate(LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtPayPeriodCheckDate']));
     return $payPeriod;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:11,代碼來源:EXTRACTOR_HspPayPeriod.php

示例13: parseData

 public function parseData($postArr)
 {
     $postArr['txtMemCommDat'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtMemCommDat']);
     $postArr['txtMemRenDat'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtMemRenDat']);
     $this->empmemship->setEmpId(trim($postArr['txtEmpID']));
     $this->empmemship->setEmpMemCode(trim($postArr['cmbMemCode']));
     $this->empmemship->setEmpMemTypeCode(trim($postArr['cmbMemTypeCode']));
     $this->empmemship->setEmpMemSubOwn(trim($postArr['cmbMemSubOwn']));
     $this->empmemship->setEmpMemSubAmount(trim($postArr['txtMemSubAmount']) == "" ? 0 : trim($postArr['txtMemSubAmount']));
     $this->empmemship->setEmpMemCommDat(self::_handleEmptyDates($postArr['txtMemCommDat']));
     $this->empmemship->setEmpMemRenDat(self::_handleEmptyDates($postArr['txtMemRenDat']));
     return $this->empmemship;
 }
開發者ID:noikiy,項目名稱:owaspbwa,代碼行數:13,代碼來源:EXTRACTOR_EmpMembership.php

示例14: parseData

 public function parseData($postArr)
 {
     $postArr['txtEmpEduStartDate'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpEduStartDate']);
     $postArr['txtEmpEduEndDate'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpEduEndDate']);
     $this->empeducation->setEmpId(trim($postArr['txtEmpID']));
     $this->empeducation->setEduCode(trim($postArr['cmbEduCode']));
     $this->empeducation->setEduMajor(trim($postArr['txtEmpEduMajor']));
     $this->empeducation->setEduYear(empty($postArr['txtEmpEduYear']) ? 'null' : trim($postArr['txtEmpEduYear']));
     $this->empeducation->setEduGPA(trim($postArr['txtEmpEduGPA']));
     $this->empeducation->setEduStartDate(self::_handleEmptyDates($postArr['txtEmpEduStartDate']));
     $this->empeducation->setEduEndDate(self::_handleEmptyDates($postArr['txtEmpEduEndDate']));
     return $this->empeducation;
 }
開發者ID:googlecode-mirror,項目名稱:pucit-orangehrm,代碼行數:13,代碼來源:EXTRACTOR_EmpEducation.php

示例15: parseData

 public function parseData($postArr)
 {
     $postArr['txtEmpExpFromDate'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpExpFromDate']);
     $postArr['txtEmpExpToDate'] = LocaleUtil::getInstance()->convertToStandardDateFormat($postArr['txtEmpExpToDate']);
     $this->empwrkexp->setEmpId(trim($postArr['txtEmpID']));
     $this->empwrkexp->setEmpExpSeqNo($postArr['txtEmpExpID']);
     $this->empwrkexp->setEmpExpEmployer(trim($postArr['txtEmpExpEmployer']));
     $this->empwrkexp->setEmpExpJobTitle(trim($postArr['txtEmpExpJobTitle']));
     $this->empwrkexp->setEmpExpFromDate(self::_handleEmptyDates($postArr['txtEmpExpFromDate']));
     $this->empwrkexp->setEmpExpToDate(self::_handleEmptyDates($postArr['txtEmpExpToDate']));
     $this->empwrkexp->setEmpExpComments(trim($postArr['txtEmpExpComments']));
     $this->empwrkexp->setEmpExpInternal(isset($postArr['chkEmpExpInternal']) ? 1 : 0);
     return $this->empwrkexp;
 }
開發者ID:googlecode-mirror,項目名稱:pucit-orangehrm,代碼行數:14,代碼來源:EXTRACTOR_EmpWorkExp.php


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