We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Based on code:
use Jenssegers\Mongodb\Eloquent\Model; class Etapa extends Model { protected $dates = ['data_inicio', 'data_termino']; public function getDataInicioAttribute($value) { return \Carbon\Carbon::createFromTimestamp($value->toDateTime()->getTimestamp())->timezone('UTC'); } public function getDataTerminoAttribute($value) { return \Carbon\Carbon::createFromTimestamp($value->toDateTime()->getTimestamp())->timezone('UTC'); } public function setDataInicioAttribute($value) { $value = \DateTime::createFromFormat('d/m/Y', $value, new \DateTimeZone('UTC')); $value->setTime(0, 0, 0); $this->attributes['data_inicio'] = new \MongoDB\BSON\UTCDateTime($value); } public function setDataTerminoAttribute($value) { $value = \DateTime::createFromFormat('d/m/Y', $value, new \DateTimeZone('UTC')); $value->setTime(0, 0, 0); $this->attributes['data_termino'] = new \MongoDB\BSON\UTCDateTime($value); } }
The text was updated successfully, but these errors were encountered:
nunomazer
No branches or pull requests
Based on code:
The text was updated successfully, but these errors were encountered: