Skip to content

Commit

Permalink
Reverted code format changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Dec 26, 2022
1 parent c41e13f commit d52f8e9
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 7 additions & 4 deletions app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ public function getCustomerLog()
*/
public function getCreateDate()
{
return ($date = $this->getCustomer()->getCreatedAt())
? $this->formatDate($date, Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true, false)
: null;
$date = $this->getCustomer()->getCreatedAt();
if (!$date) {
return null;
}
# toto with usetimezon
return $this->formatDate($date,Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM, true,false);
}

/**
Expand Down Expand Up @@ -248,10 +251,10 @@ public function isHidden()
}

/**
* @deprecated
* Return instance of core helper
*
* @return Mage_Core_Helper_Data
* @deprecated
*/
protected function _getCoreHelper()
{
Expand Down
4 changes: 3 additions & 1 deletion app/code/core/Mage/Core/Block/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,9 @@ public function helper($name)
*/
public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMAT_TYPE_SHORT, $showTime = false, $useTimezone = true)
{
return $this->helper('core')->formatDate($date, $format, $showTime, $useTimezone);
/** @var Mage_Core_Helper_Data $helper */
$helper = $this->helper('core');
return $helper->formatDate($date, $format, $showTime, $useTimezone);
}

/**
Expand Down
8 changes: 5 additions & 3 deletions app/code/core/Mage/Core/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,9 +176,11 @@ public function formatDate($date = null, $format = Mage_Core_Model_Locale::FORMA
}
}

$format = $showTime
? Mage::app()->getLocale()->getDateTimeFormat($format)
: Mage::app()->getLocale()->getDateFormat($format);
if ($showTime) {
$format = Mage::app()->getLocale()->getDateTimeFormat($format);
} else {
$format = Mage::app()->getLocale()->getDateFormat($format);
}

return $date->toString($format);
}
Expand Down

0 comments on commit d52f8e9

Please sign in to comment.