Fixes in moneyfield and dateform

This commit is contained in:
Antonio de la Rosa 2017-02-16 03:44:23 +01:00
parent be28b150ac
commit 2ca8e2ac3f
2 changed files with 13 additions and 3 deletions

View file

@ -18,11 +18,15 @@ class MoneyField extends DoubleField{
}
function check($value)
{
if(strpos($value, ','))
{
$value=str_replace('.', '', $value);
$value=str_replace(',', '.', $value);
}
$value=parent::check($value);
return round($value, 2);

View file

@ -11,6 +11,7 @@ class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm {
public $set_time=1;
public $see_title=0;
public $utc=true;
function form()
{
@ -40,10 +41,15 @@ class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm {
}
else
{
if($this->utc)
{
$value=PhaTime\DateTime::gmt_to_local($value);
}
list($year, $month, $day, $hour, $minute, $second)=PhaTime\DateTime::format_timedata($value);
}