Support of date and time custom formats... continuing towards the beta !

SVN:trunk[4019]
This commit is contained in:
Denis Flaven
2016-05-03 09:56:02 +00:00
parent 7d4e9ce069
commit 5386662146
32 changed files with 518 additions and 460 deletions

View File

@@ -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());
}
}