Skip to main content

Smart Date Notes

From the debug output, we can see that field_shift_date is using the Smart Date module (i.e., it’s a SmartDateFieldItemList). That means its underlying data structure differs slightly from Drupal’s built-in datetime fields. Specifically, you won’t get a direct value string on node.field_shift_date.value; instead, the data is tucked inside an item—for instance node.field_shift_date.0.start_value or node.field_shift_date.0.end_value.

Below are the steps to figure out which property to use and how to safely retrieve it: