protected function viewValue(FieldItemInterface $item) {
    $field = $item->getFieldDefinition();
    if ($field->get('field_type') == 'daterange') {
      $value = $item->start_date;
    }
    else {
      $value = $item->date;
    }
    $build = [
      '#theme' => 'calendar_item_date',
      '#datetime' => $value,
      '#attached' => [
        'library' => [
          'govcms8_calendar_item/calendar_item',
        ],
      ],
    ];
    return $build;
  }