-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Date and DateTime parsing #1576
Conversation
@@ -130,7 +130,7 @@ private function validateUpdate(Request $request) | |||
->respondWithError($validator->errors()->all()); | |||
} | |||
|
|||
$date = Carbon::createFromFormat('Y-m-d', $request->get('next_expected_date'), auth()->user()->timezone); | |||
$date = DateHelper::parseDate($request->get('next_expected_date')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here next_expected_date
must be parsed in iso format.
|
||
return [ | ||
'signed' => true, | ||
'signed_date' => $signedDate->format(config('api.timestamp_format')), | ||
'signed_date' => DateHelper::getTimestamp($signedDate), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
signed_date
must be render in timestamp format, with UTC timezone
@asbiin this broke the Settings index view.
I'll fix it in my PR. |
This pull request has been automatically locked since there |
Improve how dates and datetimes are parsed and rendered.
Add some function in
DateHelper
: