Version 4.1.2

This commit is contained in:
Neo committed 2025-12-19 05:32:19 -08:00
1 parent 3ba79295ee
commit 28bd025b35
1131 files changed
+63658 -20579

No files matched your search

+10 -7
View File
@@ -148,20 +148,23 @@ class _DateTime extends \DateTime
* @param bool $capialize TRUE if by itself, FALSE if in the middle of a sentence
* @return string
*/
public function html( $capialize=TRUE )
public function html( $capialize=TRUE, $short=FALSE )
{
$format = $capialize ? static::RELATIVE_FORMAT_NORMAL : static::RELATIVE_FORMAT_LOWER;
$format = $short ? 1 : ( $capialize ? static::RELATIVE_FORMAT_NORMAL : static::RELATIVE_FORMAT_LOWER );
return "<time datetime='{$this->rfc3339()}' title='{$this}' data-short='" . trim( $this->relative(1) ) . "'>" . trim( $this->relative( $format ) ) . "</time>";
}
/**
* Format the date according to the user's locale (without the time)
*
* @return string
* @param \IPS\Member $member
* @return string
*/
public function localeDate()
public function localeDate( \IPS\Member $member = NULL )
{
return \IPS\Member::loggedIn()->language()->convertString( strftime( '%x', $this->getTimestamp() + $this->getTimezone()->getOffset( $this ) ) );
$member = ( $member === NULL ) ? \IPS\Member::loggedIn() : $member;
return $member->language()->convertString( strftime( '%x', $this->getTimestamp() + $this->getTimezone()->getOffset( $this ) ) );
}
/**
@@ -243,7 +246,7 @@ class _DateTime extends \DateTime
* @return string
*/
public function localeTime( $seconds=TRUE, $minutes=TRUE )
{
{
return \IPS\Member::loggedIn()->language()->convertString( strftime( $this->localeTimeFormat( $seconds, $minutes ), $this->getTimestamp() + $this->getTimezone()->getOffset( $this ) ) );
}