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
feat: Support for range queries on time fields #429
Conversation
606e1db
to
965b111
Compare
Codecov Report
@@ Coverage Diff @@
## main #429 +/- ##
==========================================
+ Coverage 29.75% 29.84% +0.09%
==========================================
Files 77 78 +1
Lines 8173 8222 +49
==========================================
+ Hits 2432 2454 +22
- Misses 5495 5522 +27
Partials 246 246
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
5ba1288
to
915b6a4
Compare
lib/date/converter.go
Outdated
|
||
// ToUnixNano converts a RFC3339 | ||
func ToUnixNano(dateStr string) (int64, error) { | ||
t, err := time.Parse(RFC3339Nano, dateStr) |
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.
What's a good way to detect date format from user input? I would prefer to add additional layouts here.
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.
Maybe use a library? https://github.com/araddon/dateparse
Not ideal though. New dependency.
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.
Yeah, I guess better to stick to standard date time, else it can cause confusions and different queries can return different results.
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.
So the date time format is defined by us, which we are using for validation purposes. Let's stick to that format.
Also, this format needs to be in the schema package close to the DateTime data type so that we know that this format is what we are proposing to the end user for this data type. This function can still stay here and you can accept the format which will be defined in the schema package.
🎉 This PR is included in version 1.0.0-alpha.31 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
🎉 This PR is included in version 1.0.0-beta.1 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
No description provided.