0

What is the method for getting the start date value from a Smart Date field?

$s_dates = $service->get('field_date')->getValue();
dpm($s_dates); 

gives me the output:

array:6 [▼
  "value" => "1612688400"
  "end_value" => "1612688400"
  "duration" => "0"
  "rrule" => "4"
  "rrule_index" => "1"
  "timezone" => ""
]

However $s_dates = $service->get('field_date')->getValue()['value'] gives me an 'undefined index' error.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.