-
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Migrate to new timezone database #81
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #81 +/- ##
==========================================
+ Coverage 96.12% 96.40% +0.28%
==========================================
Files 55 59 +4
Lines 1521 1890 +369
==========================================
+ Hits 1462 1822 +360
- Misses 59 68 +9 ☔ View full report in Codecov by Sentry. |
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 think generally we should try to process the raw data further at compile time. In addition, what is the tzupdate.jar used for?
sugar/lib/src/time/zone/providers/universal/universal_provider.dart
Outdated
Show resolved
Hide resolved
sugar/lib/src/time/zone/providers/universal/universal_provider.g.dart
Outdated
Show resolved
Hide resolved
sugar/lib/src/time/zone/providers/universal/universal_provider.dart
Outdated
Show resolved
Hide resolved
I've added CI to test using Java. If you think this looks fine I'll add a generated Provider that loads everything at compile time |
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.
Generally LGTM! One quick question, but should we use microseconds or milliseconds as the most granular precision?
milliseconds is ok. I did make one breaking change. |
Also, I will not be adding one that compiles the raw timezones because it bloats the binary massively for only a small improvement |
I'll add an automated action that formats pull requests later today/early tomorrow. |
In this latest release, timezone providers never return a "Factory" database and return null instead. // Breaking
Timezone.timezoneProvider["Factory"] // returns null
// Non-Breaking
final tz = Timezone("Factory"); // No such timezone, return factory
final tz = Timezone("Pizza"); // No such timezone, return factory I can make this non-breaking if you want |
There is tons of formatting that this repo need and doing so will turn this PR into a nightmare to review. |
Yeah that’s a good point, this repo was created long before we standardised formatting etc internally, I’ll probably do it after this PR. I think we should return factory instead of null! |
Sure |
Done. |
CI should pass now. Ready for merging when (hopefully) passes |
This PR introduces the following changes
span
has been replaced byoffset
. This means users won't know theabbreviation
of the current offset (DST
orEST
) or whether it is currentlyisDst
. This is a change was made for the following reasons:a. Other timezone providers will have a hard time supporting this, there are very large disagreements what is considered
isDst
and in IMHO its best to avoid this issue completely.b. The span abbreviation would be really nice to have. We'll explore ways to bring it back. The issue is that DST rules don't have abbreviations associated with them.