Leantime/leantime · error · Leantime\Core\Exceptions\MissingParameterException

-32602

-32602

Error message

Date or timestamp is a required field

What it means

Error "Date or timestamp is a required field" thrown in Leantime/leantime.

Source

Thrown at app/Domain/Timesheets/Services/Timesheets.php:179

            'rate' => '',
            'description' => '',
            'invoicedEmpl' => '',
            'invoicedComp' => '',
            'invoicedEmplDate' => '',
            'invoicedCompDate' => '',
            'paid' => '',
        ];

        if (! empty($params['dateString'])) {
            $values['date'] = dtHelper()->parseUserDateTime($params['dateString'], 'start')->formatDateTimeForDb();
        } elseif (! empty($params['timestamp'])) {
            $values['date'] = CarbonImmutable::createFromTimestamp($params['timestamp'], 'UTC')->format('Y-m-d H:i:s');
        } elseif (! empty($params['date']) && empty($params['time'])) {
            $values['date'] = dtHelper()->parseUserDateTime($params['date'], 'start')->formatDateTimeForDb();
        } elseif (! empty($params['date'])) {
            $values['date'] = dtHelper()->parseUserDateTime($params['date'], $params['time'])->formatDateTimeForDb();
        } else {
            throw new MissingParameterException('Date or timestamp is a required field');
        }

        if (! isset($params['hours'])) {
            throw new MissingParameterException('Hours is a required field');
        }

        if (! isset($params['kind'])) {
            throw new MissingParameterException('Timesheet type is a required field');
        }

        $values['hours'] = $params['hours'];
        $values['description'] = $params['description'] ?? '';

        $loggingUser = $this->userRepo->getUser($values['userId']);
        $values['rate'] = $loggingUser['wage'];

        $this->timesheetsRepo->addTime($values);

View on GitHub (pinned to 9a9f49f100)

When it happens

Trigger: Thrown at app/Domain/Timesheets/Services/Timesheets.php:179 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of Leantime/leantime@9a9f49f100 (2026-08-21). Data as JSON: /api/errors/324e9eb253e2ea8a. Report an issue: GitHub.