Skip to content

Commit

Permalink
v1.1.1 #13
Browse files Browse the repository at this point in the history
  • Loading branch information
jogboms authored Nov 19, 2019
2 parents 494a9cc + b5259cd commit 0e99283
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.packages
test/.test_coverage.dart
coverage/
coverage_badge.svg
pubspec.lock

# Conventional directory for build outputs
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.1.1

- Fix breaking change from v1.1.0 by introducing @deprecated flag

## 1.1.0

- Breaking Change: renamed `later` to `fromNow` to align with other ecosystems
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ final DateTime fourHoursFromNow = DateTime.now() + Duration(hours: 4);
## 🎖 Installation
```yaml
dependencies:
time: "^1.1.0"
time: "^1.1.1"
```
### ⚡ Import
Expand Down
3 changes: 3 additions & 0 deletions lib/src/extensions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ 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;
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: time
description: Type-safe DateTime and Duration calculations, powered by extensions.
version: 1.1.0
version: 1.1.1
homepage: https://github.com/jogboms/time.dart
author: Jogboms <[email protected]>

Expand Down
4 changes: 4 additions & 0 deletions test/time_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ 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 0e99283

Please sign in to comment.