{"record":{"id":"324e9eb253e2ea8a","repo":"Leantime/leantime","slug":"32602-324e9e","errorCode":"-32602","errorMessage":"Date or timestamp is a required field","messagePattern":"Date or timestamp is a required field","errorType":"validation","errorClass":"Leantime\\Core\\Exceptions\\MissingParameterException","httpStatus":422,"severity":"error","filePath":"app/Domain/Timesheets/Services/Timesheets.php","lineNumber":179,"sourceCode":"            'rate' => '',\n            'description' => '',\n            'invoicedEmpl' => '',\n            'invoicedComp' => '',\n            'invoicedEmplDate' => '',\n            'invoicedCompDate' => '',\n            'paid' => '',\n        ];\n\n        if (! empty($params['dateString'])) {\n            $values['date'] = dtHelper()->parseUserDateTime($params['dateString'], 'start')->formatDateTimeForDb();\n        } elseif (! empty($params['timestamp'])) {\n            $values['date'] = CarbonImmutable::createFromTimestamp($params['timestamp'], 'UTC')->format('Y-m-d H:i:s');\n        } elseif (! empty($params['date']) && empty($params['time'])) {\n            $values['date'] = dtHelper()->parseUserDateTime($params['date'], 'start')->formatDateTimeForDb();\n        } elseif (! empty($params['date'])) {\n            $values['date'] = dtHelper()->parseUserDateTime($params['date'], $params['time'])->formatDateTimeForDb();\n        } else {\n            throw new MissingParameterException('Date or timestamp is a required field');\n        }\n\n        if (! isset($params['hours'])) {\n            throw new MissingParameterException('Hours is a required field');\n        }\n\n        if (! isset($params['kind'])) {\n            throw new MissingParameterException('Timesheet type is a required field');\n        }\n\n        $values['hours'] = $params['hours'];\n        $values['description'] = $params['description'] ?? '';\n\n        $loggingUser = $this->userRepo->getUser($values['userId']);\n        $values['rate'] = $loggingUser['wage'];\n\n        $this->timesheetsRepo->addTime($values);\n","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/Leantime/leantime/blob/9a9f49f1008f4782b30f6723c54228f4f992e636/app/Domain/Timesheets/Services/Timesheets.php#L161-L197","documentation":"Error \"Date or timestamp is a required field\" thrown in Leantime/leantime.","triggerScenarios":"Thrown at app/Domain/Timesheets/Services/Timesheets.php:179 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9a9f49f1008f4782b30f6723c54228f4f992e636","analyzedAt":"2026-08-21T02:37:38.966Z","schemaVersion":2},"datasetVersion":"2026-08-21T03:17:12.404Z"}