-
-
Notifications
You must be signed in to change notification settings - Fork 73
add rhombus/date
#722
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
base: master
Are you sure you want to change the base?
add rhombus/date
#722
Conversation
|
Can you say more about why you decided not to use gregor directly? Also, gregor provides a bunch of functionality that requires various tables (eg the tz database). Do you think that should eventually be a part of this library, some other standard library, or something else? |
It's a large dependency. A |
|
Along similar lines, re:
Can you say more about which problems with Racket's I noticed that there are separate fields for I looked back at racket/racket#1220 for some context. In racket/racket#1220 (comment), @97jaz wrote:
Re @samth:
In discussion around racket/racket#1220 (comment), the size of data files was mentioned as an obstacle to including Gregor in the main Racket distribution, but I hope that can be overcome. I need to refresh my memory about what needs the Another development since previous discussion is that currently-supported Windows versions provide ICU's C API as a system library (see also racket/racket#4844), and ICU integrates the tz database and CLDR data. Potentially, if we could limit ourselves to functionality exposed by the ICU C API, we could avoid distributing data files for Windows altogether. PEP 615 has this to say about that rejected alternative:
|
The main one I know is using the word "date" for "date and time". I believe the As you note, there's no attempt here to ensure that a |
|
FWIW, I agree that gregor is too large of a dependency. That's mostly due to the CLDR i18n/l10n data and code, which in hindsight I would have omitted from the library and instead provided simple strftime/strptime-like functionality (and left anything more fancy to add-on libraries). On the other hand, I still wouldn't have allowed the construction of nonsense dates and times. That's pretty easy to do with two exceptions:
|
This attempt to add time and date functions in a
rhombus/datelibrary is based on thegregorlibrary for Racket and Java'sdate.LocalTime, etc., classes. It doesn't try to do everything that those do, but instead provides basic functionality that is available fromracket/baseandracket/date, but in a form that hopefully does not preclude improvements and compatible generalization by new libraries (unlike the way Gregor has to avoid the Racketdatestructure type).I think I get why Java puts
Localin the names of classes, but I have opted not to do that, but the nameZonedDateTimedoes come from Java.API sumary: