diff --git a/CHANGELOG.md b/CHANGELOG.md index 47255a0..2decf9e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,14 @@ +## [1.0.2] + +- fix: current month & selected validation logics + ## [1.0.1] - doc: update README.md ## [1.0.0] -- BREAKING: feat: add month picker +- **BREAKING**: feat: add month picker - feat: add `monthBuilder` into config - feat: add `disableMonthPicker` into config - feat: add `useAbbrLabelForMonthModePicker` into config diff --git a/README.md b/README.md index 8330aeb..f9b9956 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CalendarDatePicker2 -[![Pub Package](https://img.shields.io/badge/pub-v1.0.1-blue)](https://pub.dev/packages/calendar_date_picker2) +[![Pub Package](https://img.shields.io/badge/pub-v1.0.2-blue)](https://pub.dev/packages/calendar_date_picker2) [![Pub Package](https://img.shields.io/badge/flutter-%3E%3D1.17.0-green)](https://flutter.dev/) [![GitHub Repo stars](https://img.shields.io/github/stars/theideasaler/calendar_date_picker2?style=social)](https://github.com/theideasaler/calendar_date_picker2) @@ -41,7 +41,7 @@ Add the following line to `pubspec.yaml`: ```yaml dependencies: -calendar_date_picker2: ^1.0.1 +calendar_date_picker2: ^1.0.2 ``` ### Basic setup diff --git a/example/pubspec.lock b/example/pubspec.lock index 3a3b341..5f37878 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -23,7 +23,7 @@ packages: path: ".." relative: true source: path - version: "1.0.1" + version: "1.0.2" characters: dependency: transitive description: diff --git a/lib/src/widgets/_impl/_month_picker.dart b/lib/src/widgets/_impl/_month_picker.dart index 0805d3a..eec3b5a 100644 --- a/lib/src/widgets/_impl/_month_picker.dart +++ b/lib/src/widgets/_impl/_month_picker.dart @@ -82,12 +82,17 @@ class _MonthPickerState extends State<_MonthPicker> { final ColorScheme colorScheme = Theme.of(context).colorScheme; final TextTheme textTheme = Theme.of(context).textTheme; final int month = 1 + index; - final bool isCurrentMonth = month == widget.config.currentDate.month; + final bool isCurrentMonth = + widget.initialMonth.year == widget.config.currentDate.year && + widget.config.currentDate.month == month; const double decorationHeight = 36.0; const double decorationWidth = 72.0; final bool isSelected = widget.selectedDates.isNotEmpty && - widget.selectedDates.any((date) => date != null && date.month == month); + widget.selectedDates.any((date) => + date != null && + widget.initialMonth.year == date.year && + date.month == month); var isMonthSelectable = widget.initialMonth.year >= widget.config.firstDate.year && widget.initialMonth.year <= widget.config.lastDate.year; diff --git a/pubspec.yaml b/pubspec.yaml index 6fb5f43..237f904 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: calendar_date_picker2 description: A lightweight and customizable calendar picker based on Flutter CalendarDatePicker, with support for single date picker, range picker and multi picker. -version: 1.0.1 +version: 1.0.2 homepage: https://github.com/theideasaler/calendar_date_picker2 environment: