Skip to content
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

DOCSP-42957: DateTimeInterface in queries #3140

Merged
merged 10 commits into from
Sep 10, 2024

Conversation

norareidy
Copy link
Contributor

@norareidy norareidy commented Sep 6, 2024

@github-actions github-actions bot added the docs label Sep 6, 2024
@norareidy norareidy marked this pull request as ready for review September 6, 2024 20:25
@norareidy norareidy requested a review from a team as a code owner September 6, 2024 20:25
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same applies in the other direction. UTCDateTime objects received as results are converted to Carbon date with the default timezone. #3119

I think this should be mentioned in the query builder docs, with an example.

docs/upgrade.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@rustagir rustagir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I left a suggestion that might change the scope of the PR, so requesting another look!

docs/upgrade.txt Outdated Show resolved Hide resolved
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding a 2nd example would make more sense that changing the existing one.

Comment on lines 156 to 158
->where('released', new UTCDateTime(
Carbon::create(2010, 1, 15, 0, 0, 0, 'UTC')
))->get();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The previous example was a lot better as it used whereDate method that convert the string to a date object. I don't think it makes sense to change it.

The purpose is to show that users can work with Carbon object without worring with UTCDateTime. This example shows the opposite of what should be done.

->where('released', Carbon::create(2010, 1, 15));

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added back the old example and kept this one - lmk what you think

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, that's perfect.

docs/query-builder.txt Outdated Show resolved Hide resolved
Copy link
Contributor

@rustagir rustagir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your changes really cleared things up! left some small suggestions

docs/upgrade.txt Outdated Show resolved Hide resolved
docs/query-builder.txt Outdated Show resolved Hide resolved
Copy link
Member

@GromNaN GromNaN left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@norareidy norareidy merged commit aebf049 into mongodb:5.0 Sep 10, 2024
15 checks passed
@norareidy norareidy deleted the DOCSP-42957-datetimeinterface branch September 10, 2024 20:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants