mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-24 02:58:43 +02:00
Support of date and time custom formats... continuing towards the beta !
SVN:trunk[4019]
This commit is contained in:
@@ -22,9 +22,55 @@ namespace Combodo\iTop\Form\Field;
|
||||
use \Combodo\iTop\Form\Field\StringField;
|
||||
|
||||
/**
|
||||
* Description of StringField
|
||||
* A field for Dates and Date & Times, supporting custom formats
|
||||
*/
|
||||
class DateTimeField extends StringField
|
||||
{
|
||||
protected $sJSDateTimeFormat;
|
||||
protected $sPHPDateTimeFormat;
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetPHPDateTimeFormat()
|
||||
{
|
||||
return $this->sPHPDateTimeFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $sFormat
|
||||
* @return \Combodo\iTop\Form\Field\DateTimeField
|
||||
*/
|
||||
public function SetPHPDateTimeFormat($sDateTimeFormat)
|
||||
{
|
||||
$this->sPHPDateTimeFormat = $sDateTimeFormat;
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function GetJSDateTimeFormat()
|
||||
{
|
||||
return $this->sDateTimeFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param string $sFormat
|
||||
* @return \Combodo\iTop\Form\Field\DateTimeField
|
||||
*/
|
||||
public function SetJSDateTimeFormat($sDateTimeFormat)
|
||||
{
|
||||
$this->sDateTimeFormat = $sDateTimeFormat;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function GetDisplayValue()
|
||||
{
|
||||
return \AttributeDatetime::Format($this->currentValue, $this->GetPHPDateTimeFormat());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user