-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix windows integration testing * add timezone abbr to offset * convert func takes datetime parts instead of millis from epch * remove old database files * add toString and correct final/initial for span * replace default provider with embedded provider * update tests * add packages to pubspec * add timezone generation tool * replace default provider with embedded * add java testing * fix dst bug, add dst and abbr to java provider * Add CI * ignore unsued * remove unused func * rename DSTRules * nits * remove base provider
- Loading branch information
1 parent
2dac846
commit 5c80700
Showing
654 changed files
with
11,607 additions
and
170,808 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
- uses: subosito/[email protected] | ||
- run: dart pub get | ||
- run: dart run coverage:test_with_coverage test ./integration_test/ | ||
- run: dart run coverage:test_with_coverage --test .\integration_test\src\time\zone\platform\platform_provider_test.dart | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
files: ./sugar/coverage/lcov.info | ||
|
@@ -87,4 +87,4 @@ jobs: | |
- run: ./integration_test/src/time/zone/platform/platform_provider_test_browser.sh | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
files: ./sugar/coverage/lcov.info | ||
files: ./sugar/coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,12 +34,23 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: subosito/[email protected] | ||
- name: Install Node | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
- name: Install Java | ||
uses: actions/setup-java@v4 | ||
with: | ||
distribution: "adopt" | ||
java-version: "11.0.26+4" | ||
- run: dart pub get | ||
- run: dart analyze --fatal-warnings | ||
- run: dart format . --set-exit-if-changed --output none | ||
- run: dart run tool/generate_timezones.dart | ||
- run: dart run coverage:test_with_coverage | ||
- run: sudo apt-get update -y | ||
- run: sudo apt-get install -y lcov | ||
- run: lcov --remove ./coverage/lcov.info '**.g.dart' -o ./coverage/lcov.info | ||
- run: lcov --remove ./coverage/lcov.info '**.g.dart' -o ./coverage/lcov.info --ignore-errors unused | ||
- uses: codecov/codecov-action@v5 | ||
with: | ||
files: ./sugar/coverage/lcov.info | ||
files: ./sugar/coverage/lcov.info |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import 'package:sugar/src/time/zone/timezone.dart'; | ||
import 'package:sugar/src/time/zone/timezone_span.dart'; | ||
import 'package:sugar/time.dart'; | ||
|
||
/// A timezone which is used when the platform's timezone could not be retrieved. | ||
class FactoryTimezone extends Timezone { | ||
/// Creates a new instance of [FactoryTimezone]. | ||
/// | ||
/// This constructor calls the super constructor with the string 'Factory'. | ||
const FactoryTimezone() : super.from('Factory'); | ||
|
||
@override | ||
(EpochMicroseconds, TimezoneSpan) convert( | ||
int year, [ | ||
int month = 1, | ||
int day = 1, | ||
int hour = 0, | ||
int minute = 0, | ||
int second = 0, | ||
int millisecond = 0, | ||
int microsecond = 0, | ||
]) => (0, span(at: 0)); | ||
|
||
@override | ||
TimezoneSpan span({required EpochMicroseconds at}) => _FactoryTimezoneSpan(offset: Offset()); | ||
} | ||
|
||
class _FactoryTimezoneSpan extends TimezoneSpan { | ||
@override | ||
EpochMicroseconds get start => TimezoneSpan.range.min.value; | ||
@override | ||
EpochMicroseconds get end => TimezoneSpan.range.max.value; | ||
|
||
/// Creates a new instance of [_FactoryTimezoneSpan]. | ||
_FactoryTimezoneSpan({required super.offset, super.abbreviation = '+0000', super.dst = false}); | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.