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

Date intervals #1561

Open
gythaogg opened this issue Jan 28, 2025 · 0 comments
Open

Date intervals #1561

gythaogg opened this issue Jan 28, 2025 · 0 comments
Labels
needs-attention This issue or pull request is in need of discussion, information, assessment by team members

Comments

@gythaogg
Copy link
Contributor

gythaogg commented Jan 28, 2025

The django-interval field is useful to store fuzzy dates as intervals but it currently does not support BCE dates (acdh-oeaw/django-interval#23 ) as Python datetime fields do not support negative year (Guido van Rossum's comments here: https://discuss.python.org/t/bc-date-support/582).

  1. Could we sort this out by saving the dates as integers? Is this going to be milliseconds elapsed from an epoch that we set?
  2. In that case it would be necessary also to convert this to a human readable date format to show the actual range we are saving in the database
  3. Sorting should work automatically based on the value of sort_date field if we choose integers. For filtering should we write our own methods?
  4. Other formats potentially useful for storing BCE dates:

Lastly, it seems like python's calendar understands negative years - https://docs.python.org/3.12/library/calendar.html

Year 0 is 1 BC, year -1 is 2 BC, and so on.

@gythaogg gythaogg added the needs-attention This issue or pull request is in need of discussion, information, assessment by team members label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-attention This issue or pull request is in need of discussion, information, assessment by team members
Projects
None yet
Development

No branches or pull requests

1 participant