-
-
Notifications
You must be signed in to change notification settings - Fork 279
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
MBS-486: Add support for years BCE #1723
base: master
Are you sure you want to change the base?
Conversation
d1eee2a
to
76de4e1
Compare
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 didn't test this yet, but just a few small things I noticed so far
2ea5ae5
to
3c10d0a
Compare
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.
This seems like a good start.
I can't enter "-0001" in the release or relationship editors, but I'm not sure these are useful there (i.e. if it's worth fixing the validation in two more places). Anyway, those cases will likely start working as we consolidate the date period components in the future.
It might be useful in the relationship editor (but quite rarely) and should probably never happen in the release editor anyway. I could add it to the relationship editor, if we want to. We might need to check if it anything needs to be changed in the alias form fields if those get merged sooner. |
Rebased this on current master, seems to actually work fine in the alias form too, so hopefully it's still fine! Bringing this back because the few ones we already have are causing issues, see https://community.metabrainz.org/t/bc-dates-issue/551104 :) |
Wouldn’t that break JSON+LD given https://schema.org/Date? |
Well, in theory ISO_8601 supports BC years (https://en.wikipedia.org/wiki/ISO_8601 says so at least) and I assume given there's plenty of philosophers and whatnot probably supported by schema.org, they are able to parse those. But I haven't actively tested JSON-LD on these, are you seeing issues, other than the year being negative? |
Not like that; See Monkey’s comment about it. It requires at least five digits or it can be mistaken with a shortened notation. (By the way, that comment has been entered during Summit 19; See related notes.) |
Hmm. I'm not sure I'm seeing the issue. My understanding is that if it goes over the 4 digits (plus - sign) then we need to have a specified number of extra digits, but the example just after for example mentions that 2BC = −0001. The LOC specs for example have 4 digits by default, it seems: http://www.loc.gov/standards/datetime/ |
75a3cf6
to
d5d516f
Compare
5b35d32
to
bfab2b4
Compare
This now works on relationships, since they use the React components. It doesn't work on the release editor, but given BCE releases are AFAICT not a thing, it's probably fine. That said, there's currently a bug with relationships - we're meant to enter the year as BCE, but store it as astronomical. As such, since |
If I understand the issue correctly, Perhaps we can change |
Yeah. I was just not sure how to tell whether the date is new (state-only) or old - how would you keep track in a sane way? |
We have had kinda semi-broken BCE support for decades, but we have legitimate artists who were born and died BCE, and places old enough that they were founded BCE, for example. This adds proper support for BCE dates. The dates are stored in standard astronomical format (1 BCE = 0) but they are always shown to the user as the more intuitive version without a year 0 on the website (including for entering and editing). On the API, which is mostly meant for machine usage, the astronomical format is retained. Year 0 is blocked when editing since it's not a valid year in BCE style. I added a more precise error when validating and in React forms. I did not bother to implement the same error in TT, since the date is rejected as invalid there anyway, which is still correct (just slightly less clear).
Implement MBS-486
We have had kinda semi-broken BCE support for decades, but we have legitimate artists who were born and died BCE, and places old enough that they were founded BCE, for example. This adds proper support for BCE dates.
The dates are stored in standard astronomical format (1 BCE = 0) but they are always shown to the user as the more intuitive version without a year 0 on the website (including for entering and editing). On the API, which is mostly meant for machine usage, the astronomical format is retained.
Year 0 is blocked when editing since it's not a valid year in BCE style. I added a more precise error when validating and in React forms. I did not bother to implement the same error in TT, since the date is rejected as invalid there anyway, which is still correct (just slightly less clear).