-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(server): do not return year with weird timezone info i.e before 1890 #15713
base: main
Are you sure you want to change the base?
Conversation
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.
You can move that to the subquery for generate_series
, wrapping it in greatest
.
I am not sure I completely get what you mean. Understand the part of moving it into |
I mean that you can do something like |
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.
I don't think we should just straight up not return things like this. If there are timezones that JS can't handle, I think it'd be better if we just drop the timezone part there altogether. As it stands, this change would mean that assets will just disappear.
Strongly agree with @bo0tzz. |
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 it would be better to just unset the timezone for these instead. Or, add more validation around what timezones we accept when the date is this old
According to Wikipedia the oldest driving photograph is from 1826: Edit: 1890 is a good cutoff though because realistically no one had a camera until after that. |
I think there's more to the consideration than just what might be the oldest camera photograph. As an example, people might want to store scans of older art or documents, not to mention the possibility of a file just having bad metadata with a year far in the past - assets disappearing unexpectedly will always cause issues somewhere. |
Are there any examples of the dates/timezone combinations that supposedly have issues? |
Some older years come with a timezone JS time doesn't recognize, rendering an invalid date. This PR adds the year cutoff for queries that could have trouble with the said years