Skip to content

Commit

Permalink
v2.0 #40
Browse files Browse the repository at this point in the history
  • Loading branch information
jogboms authored Mar 5, 2021
2 parents d7ba3d5 + d145895 commit 59f9b36
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 13 deletions.
17 changes: 17 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
## 2.0.0

- Migrate to null-safety

## 1.5.0-nullsafety.1

- Introduce `isAtSameYearAs` extension to `DateTime`
- Introduce `isAtSameMonthAs` extension to `DateTime`
- Introduce `isAtSameDayAs` extension to `DateTime`
Expand All @@ -18,6 +23,18 @@ print(specificDate.isAtSameMonthAs(otherDate)); // false
print(specificDate.isAtSameDayAs(otherDate)); // false
```

## 1.4.1

- Introduce `isAtSameYearAs` extension to `DateTime`
- Introduce `isAtSameMonthAs` extension to `DateTime`
- Introduce `isAtSameDayAs` extension to `DateTime`
- Introduce `isAtSameHourAs` extension to `DateTime`
- Introduce `isAtSameMinuteAs` extension to `DateTime`
- Introduce `isAtSameMillisecondAs` extension to `DateTime`
- Introduce `isAtSameMicrosecondAs` extension to `DateTime`
- Introduce `isLeapYear` extension to `DateTime`
- Introduce `daysInMonth` extension to `DateTime`

## 1.5.0-nullsafety.0
- Migrated to null-safe dart

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ final DateTime fourHoursFromNow = DateTime.now() + Duration(hours: 4);
## 🎖 Installation
```yaml
dependencies:
time: "^1.3.0"
time: "^2.0.0"
```
### ⚡ Import
Expand Down
3 changes: 0 additions & 3 deletions lib/src/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -210,9 +210,6 @@ extension DurationTimeExtension on Duration {
/// Adds the Duration to the current DateTime and returns a DateTime in the future
DateTime get fromNow => DateTime.now() + this;

@Deprecated('Use fromNow instead. Will be removed in 2.0.0')
DateTime get later => fromNow;

/// Subtracts the Duration from the current DateTime and returns a DateTime in the past
DateTime get ago => DateTime.now() - this;

Expand Down
9 changes: 4 additions & 5 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
name: time
description: Type-safe DateTime and Duration calculations, powered by extensions.
version: 1.5.0-nullsafety.1
version: 2.0.0
homepage: https://github.com/jogboms/time.dart
author: Jogboms <[email protected]>

environment:
sdk: ">=2.12.0-0 <3.0.0"
sdk: ">=2.12.0 <3.0.0"

dev_dependencies:
pedantic: ^1.10.0-nullsafety.3
test: ^1.16.0-nullsafety.11
pedantic: ^1.11.0
test: ^1.16.5
test_coverage:
git:
url: https://github.com/jogboms/test-coverage.git
4 changes: 0 additions & 4 deletions test/time_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -530,10 +530,6 @@ void main() {
expect(7.days.fromNow, _isAbout(DateTime.now() + 7.days));
});

test('can still use later until 2.0.0', () {
expect(7.days.later, _isAbout(DateTime.now() + 7.days));
});

test('can be converted into a previous DateTime', () {
expect(7.days.ago, _isAbout(DateTime.now() - 7.days));
});
Expand Down

0 comments on commit 59f9b36

Please sign in to comment.