本文整理汇总了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);
}
示例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;
}
示例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;
}
示例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;
}
示例5: getLastSentLocalized
public function getLastSentLocalized($sFormat = 'x')
{
if ($this->getLastSent() != null) {
return LocaleUtil::localizeDate($this->getLastSent(), null, $sFormat);
}
return null;
}
示例6: getPublishAtFormatted
public function getPublishAtFormatted($sLanguageId = null, $sFormatString = 'x')
{
if ($this->publish_at === null) {
return null;
}
return LocaleUtil::localizeDate($this->publish_at, $sLanguageId, $sFormatString);
}
示例7: getDateSentFormatted
public function getDateSentFormatted($sAddTimeFormat = null)
{
$sTime = LocaleUtil::localizeDate($this->date_sent);
if ($sAddTimeFormat) {
$sTime .= ' ' . $this->getDateSent($sAddTimeFormat);
}
return $sTime;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}