Drupal 8 get type. You can replace the string with your date variables.