Fixes in dates
This commit is contained in:
parent
c873d10b49
commit
92af207e31
3 changed files with 19 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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=='')
|
||||
|
|
|
|||
|
|
@ -693,6 +693,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.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue