-
Notifications
You must be signed in to change notification settings - Fork 1
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
Next release Crystal 0.25.0 will have time zone support in standard library #1
Comments
Moreover. 0.25.0 has breaking changes: require "time_zone"
^
in lib/time_zone/src/time_zone.cr:19: while requiring "./time_zone/time"
require "./time_zone/time"
^
in lib/time_zone/src/time_zone/time.cr:4: while requiring "./time/canonical_time_instance_methods"
require "./time/canonical_time_instance_methods"
^
in lib/time_zone/src/time_zone/time/canonical_time_instance_methods.cr:4: undefined constant ::Time::Kind
alias Kind = ::Time::Kind |
@DmytroStepaniuk That actually doesn't matter much because with Crystal 0.25.0 you can just use stdlib's |
@straight-shoota I was playing with |
Then you should open an issue there to remove this dependency and replace |
Suddenly, I found that Time::Kind is using in strange way... I would say... Its unused 🤔 Anyway, building https://travis-ci.org/DmytroStepaniuk/time_zone/builds/394137156 |
Well. Actually const https://github.com/imdrasil/time_zone/blob/master/src/time_zone/time/parser.cr#L107 |
Mostly all features of this shard are included stdlib - that's true. But there still several useful methods (like getting the current time from the time zone instance). Jennifer |
@imdrasil You mean a repository of time zone database in Crystal files similar to As far as I can tell, it would be better to include the time zone database in binary format if you need to ship a copy of it compiled into a Crystal executable. This can be read by the stdlib implementation very efficiently and is probably more space efficient. Most importantly, it doesn't rely on maintaining a custom copy of the database as Crystal shard (it needs to be updated infrequently, several times a year). There might be advantages of having the database in Crystal code available, but I fail to see any significant ones. Useful feature can certainly be discussed to be included in the stdlib. Maybe we can take a look at what would fit there and what is better left in a shard? It's great to see that |
Crystal's stdlib has had support for time zones since early this year in master and it will be included in the upcoming release Crystal 0.25.0. Maybe you have already taken a look at this? (the process is documented in crystal-lang/crystal#5324)
Most of the features this shard provides are already implemented there, even with a cleaner API (due to being directly integrated in the standard library).
There are a certainly quite a few things this shard offers that are not in the stdlib implementation. For example parsing timezone db files in text format (this is usually not really needed as the binary format is more memory and time efficient). Or integrating country codes to time zones, mostly trivial mapping.
Maybe there are other features as well, that I've missed. Please let me know!
While such features are probably not all suited for the standard library, it would certainly make sense to make them available as shards integrating with the new time zone API in the stdlib.
This could be a good time to join forces and discuss design and implementations of a new time and time zone related shard to provide enhanced features based on the stdlib API.
I'd be happy if you're willing to contribute.
The text was updated successfully, but these errors were encountered: