Skip to content

Datetime field type

Jelle Spekken edited this page Jun 10, 2014 · 2 revisions

Field type: DateTime

The datetime field type is used to display a date input field with a datetime selector. This field will show you the year, month, day, hours, minutes and seconds.

  • If you only want a date field. Use the DateField.
  • If you only want a time field. Use the TimeField.
$mapper->datetime('field-name', 'default value')
    ->label('My great label'); // (optional) This will override the standard field label

The first argument is the field name relative to the name in your database (or overwritten via an attribute accessor)

The second argument will be the default value if non is present. This argument is of course optional but has to be formatted in a valid datetime string.

Clone this wiki locally