Skip to content

Bug: Class 'Locale' not found when I try to use Time::parse() #2519

Description

@ChibuezeAgwuDennis

Hello I just rum my cmd command for composer to update my codeigniter 4 framework.
Now I got this problem

Error

Class 'Locale' not found

SYSTEMPATH/I18n\Time.php at line 108

101      * @param string|null $locale
102      *
103      * @throws \Exception
104      */
105     public function __construct(string $time = null, $timezone = null, string $locale = null)
106     {
107         // If no locale was provided, grab it from Locale (set by IncomingRequest for web requests)
108         $this->locale = ! empty($locale) ? $locale : Locale::getDefault();
109 
110         // If a test instance has been provided, use it instead.
111         if (is_null($time) && static::$testNow instanceof Time)
112         {
113             if (empty($timezone))
114             {
115                 $timezone = static::$testNow->getTimezone();

Just like the "Locale" class file has been removed. Please try to solve this issue.



This happen when i try to use this:

$time = CodeIgniter\I18n\Time::parse($time, getConfig('site_timezone'));
return $time->humanize();

I am waiting for this issue to be solve.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugVerified issues on the current code behavior or pull requests that will fix them

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions