Ошибка (Error): Call to a member function getFormattedDate() on null