Skip to content

Commit 1182b7c

Browse files
committed
Fixed MonthTimeRange.format()
1 parent faf2551 commit 1182b7c

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## 3.3.1
2+
3+
- Fixed MonthTimeRange.format() would return "This month" for different year's
4+
same months.
5+
16
## 3.3.0
27

38
- Fixed where `PageableRange.next` and/or `PageableRange.last` could end up with

lib/src/localizations/mixins/simple_range.dart

+3-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ mixin SimpleRange on MomentLocalization {
7676

7777
return super.range(range, anchor: anchor, useRelative: useRelative);
7878
} else if (range is MonthTimeRange) {
79-
if (useRelative && range.month == anchor.month) {
79+
if (useRelative &&
80+
range.year == anchor.year &&
81+
range.month == anchor.month) {
8082
return simpleRangeData.thisMonth;
8183
}
8284

pubspec.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name: moment_dart
22
description: Multi-purpose immutable DateTime subclass. Supports multiple localizations to easily convert DateTime and Duration into human-readable format
3-
version: 3.3.0
3+
version: 3.3.1
44
homepage: https://github.com/sadespresso/moment_dart
55
issue_tracker: https://github.com/sadespresso/moment_dart/issues
66
funding:

0 commit comments

Comments
 (0)