Это решение сработало для меня
;(function($){
// your code
})(jQuery);
Перенесите свой код внутри замыкания и используйте $
вместо jQuery
Я нашел указанное решение в https://magento.stackexchange.com/questions/33348/uncaught-typeerror-undefined-is-not-a-function-when-using-a-jquery-plugin-in-ma
... после поиска слишком много
Это должно сработать:
$oldestPerson = null;
$oldestBirthday = new DateTime(); // preparing to save the oldest found birthday to compare against
for($i=0; $i<count($persons);$i++){
// create a DateTime Object out of the birthday-string
$birthday = DateTime::createFromFormat("d/m/y", $persons[$i]['Birthday']);
if($birthday < $oldestBirthday){ // compare this to the oldest (=smallest) saved one
$oldestPerson = $persons[$i]; // update
$oldestBirthday = $birthday; // update
}
}
print_r($oldestPerson);