Created
January 21, 2014 15:51
-
-
Save khalil-tabbal/8542635 to your computer and use it in GitHub Desktop.
patch field.datetime.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Pre field add | |
* | |
* Before we add the field to a stream | |
* | |
* @access public | |
* @param obj | |
* @param obj | |
* @return void | |
*/ | |
public function field_assignment_construct($field, $stream) | |
{ | |
// Is this in UNIX time? | |
if (isset($field->field_data['storage']) and $field->field_data['storage'] == 'unix') | |
{ | |
$this->db_col_type = 'int'; | |
return true; | |
} | |
else | |
{ | |
// If not unix, let's see if we can need the | |
// time part in our MySQL date/time | |
if ($field->field_data['use_time'] == 'no') | |
{ | |
$this->db_col_type = 'date'; | |
} | |
elseif ($field->field_data['use_time'] == 'yes') | |
{ | |
$this->db_col_type = 'datetime'; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment