Problem with datetime field in "compound" Field

I’m trying to create a custom field that has both a location and date attributes.

I’ve created a custom FieldType Code is below.

namespace Drupalchronological_locationPluginFieldFieldType;

use DrupalCoreFieldFieldItemBase;
use DrupalCoreFieldFieldStorageDefinitionInterface;
use DrupalCoreTypedDataDataDefinition;
use DrupalCoreFieldPluginFieldFieldTypeDateTimeItem;

/**
 * Plugin implementation of the 'chronological location' field type.
 *
 * @FieldType(
 *   id = "chronological_location",
 *   label = @Translation("Chronological Location"),
 *   description = @Translation("An multiple attribute field representing the location of something within a time interval."),
 *   default_widget = "chronological_location_widget",
 * )
 */
class ChronologicalLocationFieldType extends FieldItemBase {

// methods here.
//

    /**
     * {@inheritdoc}
     */
    public static function defaultSettings() {
        return array(
                'location_name' => 'location place holder',
                'lat' => 30.01,
                'long' => 60.01,
                'start_date' => '9999-12-31 23:59:59',
                'end_date' => '9999-12-31 23:59:59',
            ) + parent::defaultSettings();
    }

    /**
     * {@inheritdoc}
     */
    public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
        $properties = [];
        $properties['location_name'] = DataDefinition::create('string')->setLabel(
            t('The location name.'));
        $properties['lat'] = DataDefinition::create('float')->setLabel(
            t('The latitude of the location.'));
        $properties['long'] = DataDefinition::create('float')->setLabel(
            t('The longitude of the location.'));
        $properties['start_date'] = DataDefinition::create("datetime")->setLabel(
            t('The Start Date of the time block'));
        $properties['end_date'] = DataDefinition::create("datetime")->setLabel(
            t('The End Date of the time block'));
        return $properties;
    }

    /**
     * {@inheritdoc}
     */
    public static function schema(FieldStorageDefinitionInterface $field_definition) {
        return [
            'columns' => [
                'location_name' => [
                    'type' => 'varchar',
                    'length' => 64,
                ],
                'lat' => [
                    'type' => 'float',
                ],
                'long' => [
                    'type' => 'float',
                ],
                'start_date' => [
                    'type' => 'datetime',
                ],
                'end_date' => [
                    'type' => 'datetime',
                ]
            ]
        ];
    }

}

And I’ve created a a widget for the Field.



namespace Drupalchronological_locationPluginFieldFieldWidget;

use DrupalCoreFieldFieldItemListInterface;
use DrupalCoreFieldWidgetBase;
use DrupalCoreFormFormStateInterface;

/**
 *
 * Plugin implementation of the 'chronological_location_widget' widget.
 *
 * @FieldWidget(
 *   id = "chronological_location_widget",
 *   label = @Translation("chronological location field"),
 *   field_types = {
 *     "chronological_location"
 *   },
 *   multiple_values = TRUE,
 * )
 *
 * Created by PhpStorm.
 * User: richard
 * Date: 6/1/17
 * Time: 10:10 AM
 */
class ChronologicalLocationWidget extends WidgetBase
{
    /**
     * {@inheritdoc}
     */
    public function formElement(FieldItemListInterface $items, $delta, array $element, array &$form, FormStateInterface $form_state) {

        $element['location_name'] = [
            '#type' => 'textfield',
            '#title' => $this->t('Location Name'),
            '#required' => FALSE,
            '#size' => 64
        ];

        $element['lat'] = [
            '#type' => 'number',
            '#title' => $this->t('Latitude'),
            '#size' => 10
        ];

        $element['long'] = [
            '#type' => 'number',
            '#title' => $this->t('Longitude'),
            '#size' => 10
        ];

        $element['start_date'] = [
            '#type' => 'datetime',
            '#title' => $this->t('Start Date'),
        ];

        $element['end_date'] = [
            '#type' => 'datetime',
            '#title' => $this->t('End Date'),
        ];

        $element += [
            '#type' => 'fieldset',
        ];

        return $element;
    }
}

When I try to add the custom field to an entity the following SQL is used to create the table for the new field and the datetime fields I’ve setup are missing the critical DATETIME setting in the SQL.

CREATE TABLE node__field_travel_history ( 
`bundle` VARCHAR(128) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'The field instance bundle to which this row belongs, used when deleting a field instance', 
`deleted` TINYINT NOT NULL DEFAULT 0 COMMENT 'A boolean indicating whether this data item has been deleted', 
`entity_id` INT unsigned NOT NULL COMMENT 'The entity id this data is attached to', 
`revision_id` INT unsigned NOT NULL COMMENT 'The entity revision id this data is attached to', 
`langcode` VARCHAR(32) CHARACTER SET ascii COLLATE ascii_general_ci NOT NULL DEFAULT '' COMMENT 'The language code for this data item.', 
`delta` INT unsigned NOT NULL COMMENT 'The sequence number for this data item, used for multi-value fields', 
`field_travel_history_location_name` VARCHAR(64) NULL DEFAULT NULL, 
`field_travel_history_lat` FLOAT NULL DEFAULT NULL, 
`field_travel_history_long` FLOAT NULL DEFAULT NULL, 
`field_travel_history_start_date` NULL DEFAULT NULL, 
`field_travel_history_end_date` NULL DEFAULT NULL, 
PRIMARY KEY (`entity_id`, `deleted`, `delta`, `langcode`), 
INDEX `bundle` (`bundle`), 
INDEX `revision_id` (`revision_id`) ) 
ENGINE = InnoDB DEFAULT CHARACTER SET utf8mb4 
COLLATE utf8mb4_general_ci COMMENT 'Data storage for node field field_travel_history.'

Any ideas on this would be more than welcome.

Drupal version: 


Source: https://www.drupal.org/taxonomy/term/4/feed