Skip to content

Move to Carbon? #4

@b3nl

Description

@b3nl

Laravel comes bundled with https://github.com/briannesbitt/Carbon so, my suggestion, why not move away from raw DateTime to carbon?
We could refactor some things like:

BestIt\Harvest\Endpoints\Timesheet

    public function all($slim = true, DateTime $dateTime = null, $userId = null)
    {
        // ... 

        if ($dateTime !== null) {
            $day = (int) $dateTime->format('z') + 1;
            $year = $dateTime->format('Y');

            $uri .= "/{$day}/{$year}";
        }

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions