diff --git a/src/CoreFields/DateField.php b/src/CoreFields/DateField.php index 0ef8c2e..bb43345 100644 --- a/src/CoreFields/DateField.php +++ b/src/CoreFields/DateField.php @@ -60,6 +60,12 @@ class DateField extends PhangoField { $value=PhaTime\DateTime::local_to_gmt( $new_timestamp ); } + else + { + + $value=PhaTime\DateTime::now(); + + } } else if(strpos($value, '-')!==false) diff --git a/src/Forms/DateForm.php b/src/Forms/DateForm.php index fe8fe85..93a94d3 100644 --- a/src/Forms/DateForm.php +++ b/src/Forms/DateForm.php @@ -5,6 +5,7 @@ namespace PhangoApp\PhaModels\Forms; use PhangoApp\PhaI18n\I18n; use PhangoApp\PhaUtils\Utils; use PhangoApp\PhaTime; +use PhangoApp\PhaModels\CoreFields\DateField; class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm { @@ -16,6 +17,15 @@ class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm { $value=$this->default_value; + if(gettype($value)=='array') + { + + $t=new DateField(''); + + $value=$t->check($value); + + } + settype($value, 'string'); if($value=='') @@ -76,4 +86,4 @@ class DateForm extends \PhangoApp\PhaModels\Forms\BaseForm { } -?> \ No newline at end of file +?> diff --git a/src/Webmodel.php b/src/Webmodel.php index 6f33fd3..77ce554 100644 --- a/src/Webmodel.php +++ b/src/Webmodel.php @@ -694,6 +694,8 @@ class Webmodel { /** * This method is used for make raw string queries. * + * @warning: Don't use it, use better execute method + * * TODO: Add an sql builder cache?. I can create a file with all cache queries and load this when i connect to database. */