mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-02-02 11:29:23 +01:00
Pre-process non-integer dates / times before sending
This commit is contained in:
parent
e6ac48db13
commit
df9f42ba3a
@ -43,6 +43,20 @@ class etemplate_widget_date extends etemplate_widget_transformer
|
|||||||
*/
|
*/
|
||||||
protected $legacy_options = 'dataformat,mode';
|
protected $legacy_options = 'dataformat,mode';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Change value to be an integer - client side only deals in timestamps
|
||||||
|
*/
|
||||||
|
public function beforeSendToClient($cname)
|
||||||
|
{
|
||||||
|
if (!empty($this->attrs['dataformat'])) // Non-integer timestamp
|
||||||
|
{
|
||||||
|
$form_name = self::form_name($cname, $this->id);
|
||||||
|
$value =& self::get_array(self::$request->content, $form_name, true);
|
||||||
|
$date = DateTime::createFromFormat($this->attrs['dataformat'], $value);
|
||||||
|
$value = $date->getTimestamp();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Validate input
|
* Validate input
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user