mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-23 02:28:44 +02:00
Support of date and time custom formats... for custom fields !!
SVN:trunk[4023]
This commit is contained in:
@@ -4025,6 +4025,20 @@ class AttributeDate extends AttributeDateTime
|
||||
|
||||
public function GetEditClass() {return "Date";}
|
||||
protected function GetSQLCol($bFullSpec = false) {return "DATE";}
|
||||
|
||||
/**
|
||||
* Override to specify Field class
|
||||
*
|
||||
* When called first, $oFormField is null and will be created (eg. Make). Then when the ::parent is called and the $oFormField is passed, MakeFormField behave more like a Prepare.
|
||||
*/
|
||||
public function MakeFormField(DBObject $oObject, $oFormField = null)
|
||||
{
|
||||
$oFormField = parent::MakeFormField($oObject, $oFormField);
|
||||
$oFormField->SetDateOnly(true);
|
||||
|
||||
return $oFormField;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -214,30 +214,27 @@ class DateTimeFormat
|
||||
|
||||
/**
|
||||
* Get a date or datetime format string in the Excel format
|
||||
* @param string $sFormat
|
||||
* @return string The format string using the Excel convention
|
||||
*/
|
||||
public function ToExcel($sFormat = null)
|
||||
public function ToExcel()
|
||||
{
|
||||
return $this->Transform('datepicker', "%s");
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a date or datetime format string in the moment.js format
|
||||
* @param string $sFormat
|
||||
* @return string The format string using the moment.js convention
|
||||
*/
|
||||
public function ToMomentJS($sFormat = null)
|
||||
public function ToMomentJS()
|
||||
{
|
||||
return $this->Transform('moment', "[%s]", true /* escape all */);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a placeholder text for a date or datetime format string
|
||||
* @param string $sFormat
|
||||
* @return string The placeholder text (localized)
|
||||
*/
|
||||
public function ToPlaceholder($sFormat = null)
|
||||
public function ToPlaceholder()
|
||||
{
|
||||
$aMappings = static::GetFormatMapping();
|
||||
$sResult = '';
|
||||
|
||||
Reference in New Issue
Block a user