gregor
gregor copied to clipboard
Date and time library for Racket
(Maybe this is nit-picking, but I ran into it yesterday and it frustrated me for a while.) In the TR35 [Date Field Symbol Table](https://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Field_Symbol_Table), "Z" with No=5 is described as:...
The [docs](https://docs.racket-lang.org/gregor/time-format.html#%28def._%28%28lib._gregor%2Fmain..rkt%29._iso8601-~3edatetime%29%29) for `iso8601->datetime` say: > `(iso8601->datetime str) → date?` and the final word of that line even links to Gregor's `date?` predicate. Empirically, however, it returns a `datetime`, which...
It looks like `~t` produces incorrect years for some dates when the current locale is `fr`. ```racket > (current-locale "") > (~t (date 2023 05 31) "YYYY") "2023" > (current-locale...
First of all: this is a very nice package! Keep up the good work! I'd like to use gregor in a project together with typed racket. I was able to...
toml-racket is looking to consume this library. Weirdly, it seems to pull in racket-doc and/or racket-index. This bloats out a minimal racket install significantly. It also impacts the size of...
The documentation for `(~t)` states that the contract is: `(or/c time-provider? date-provider?)` but on passing it a date there is a contract violation: ``` ~t: contract violation expected: (and/c time-provider?...
Most of `gregor`'s values work with `racket/serialize`, but periods currently do not: ``` $ racket Welcome to Racket v7.9 [cs]. > (require gregor/period racket/serialize) > (serialize (hours 1)) ; serialize:...
According to the docs, `parse-moment` “Parses `str` according to `pattern`, which uses the CLDR pattern syntax … If the input cannot be parsed as a moment, `exn:gregor:parse` is raised.” `z`...
Is it possible to add period arithmetic? For example, we should be able to add two periods together, or perhaps scale one period by a real number.
These patches improve the performance of the `~t` time object formatter. Basically instead of recomputing a string conversion function for the format string each time `~t` is used we memoize...