First, thanks for your effort making this extension!
Environment: DatetimeAdvanced v1.0.4, PW 3.0.148, PHP 7.4.6, mysql 5.7., Timezone ist set.
While accessing subfields as selectors within a $pages-find() works fine, i am having trouble using subfields within PageArray results. Definitely i miss something here. Maybe i should stop working for today, but meanwhile someone maybe have a hint what i am doing wrong...
Thx, Olaf
<?php
foreach($results as $result) {
// Directly access gives me "Notice: Trying to get property 'year' of non-object"
echo $result->programm_date_advanced->year;
// strftime shorthand gives me "Fatal error: Uncaught Error: Call to a member function strftime() on string"
echo $result->programm_date_advanced->strftime('%Y');
// Using strftime plain gives me "Notice: A non well formed numeric value encountered"
echo strftime('%Y', $result->programm_date_advanced);
// Using strftime unformatted gives me "Warning: strftime() expects parameter 2 to be int, object given"
echo strftime('%Y', $result->getUnformatted('programm_date_advanced'));
// Plain output is o.k.
echo $result->programm_date_advanced; // e.g. 10.07.2020
}
?>