DateTimeField

Added v0.2.77
Column Type date/time/datetime/timestamp

$field = DateTimeField::make('my_datetime_column');

Column Types

$field->setColumnType('date');
$field->columnType('date');
$field->getColumnType();      // 'date'
$field->columnType();         // 'date'

This field type can be used with the date, time, datetime or timestamp MySQL column types.

Setting the column type will show and hide the different inputs as necessary. E.g. The date column type will not show the time inputs.

Hiding the seconds column

You can hide the seconds column. When hidden the seconds will always be set to 0.

$field->setHideSeconds(true);
$field->getHideSeconds(); // true
$field->hideSeconds(true);
$field->hideSeconds(); // true