diff --git a/lib/features/common/packages/bluetooth/blueberry_ring/domain/blueberry_ring_background_notifications_use_case.dart b/lib/features/common/packages/bluetooth/blueberry_ring/domain/blueberry_ring_background_notifications_use_case.dart index 9c0e3f52..3bdebe7c 100644 --- a/lib/features/common/packages/bluetooth/blueberry_ring/domain/blueberry_ring_background_notifications_use_case.dart +++ b/lib/features/common/packages/bluetooth/blueberry_ring/domain/blueberry_ring_background_notifications_use_case.dart @@ -29,10 +29,10 @@ class BlueberryRingBackgroundNotificationsUseCase extends ReactiveUseCase { // Get spteps data from cache and compare // If steps is below a certain number then show a // Below 5000 - final todaysData = data.where((e) => DateUtils.isDateOnToday(e.dateTime)); + final todaysData = data.where((e) => MXCTime.isDateOnToday(e.dateTime)); print( 'checkActivityReminder:todaysData ${todaysData.map((e) => e.toJson()).toList()}'); - final totalSteps = data.map((item) => item.step).reduce((a, b) => a + b); + final totalSteps = todaysData.map((item) => item.step).reduce((a, b) => a + b); print('checkActivityReminder:totalSteps $totalSteps'); if (totalSteps < 5000) { @@ -48,7 +48,7 @@ class BlueberryRingBackgroundNotificationsUseCase extends ReactiveUseCase { print('checkSleepInsight:data ${data.map((e) => e.toJson()).toList()}'); // If sleeps is below standard level // loop throug all and get average - final todaysData = data.where((e) => DateUtils.isDateOnToday(e.dateTime)); + final todaysData = data.where((e) => MXCTime.isDateOnToday(e.dateTime)); print( 'checkSleepInsight:todaysData ${todaysData.map((e) => e.toJson()).toList()}'); @@ -72,7 +72,7 @@ class BlueberryRingBackgroundNotificationsUseCase extends ReactiveUseCase { print('checkHeartAlert:data ${data.map((e) => e.toJson()).toList()}'); // If below standard but between person to person different final latestData = data.last; - final isToday = DateUtils.isDateOnToday(latestData.dateTime); + final isToday = MXCTime.isDateOnToday(latestData.dateTime); print('checkHeartAlert:isToday $isToday'); print('checkHeartAlert:latestData $latestData'); diff --git a/lib/features/common/packages/bluetooth/blueberry_ring/utils/date_utils.dart b/lib/features/common/packages/bluetooth/blueberry_ring/utils/date_utils.dart deleted file mode 100644 index c789d625..00000000 --- a/lib/features/common/packages/bluetooth/blueberry_ring/utils/date_utils.dart +++ /dev/null @@ -1,16 +0,0 @@ -class DateUtils { - static bool isDateOnToday( - DateTime date, - ) { - final now = DateTime.now(); - return isDateOnSpecificDay(date, now); - } - - static bool isDateOnSpecificDay(DateTime date, DateTime targetDay) { - final isTargetDay = targetDay.year == date.year && - targetDay.month == date.month && - targetDay.day == date.day; - - return isTargetDay; - } -} diff --git a/lib/features/common/packages/bluetooth/blueberry_ring/utils/utils.dart b/lib/features/common/packages/bluetooth/blueberry_ring/utils/utils.dart index 9b33e4d6..1838d80c 100644 --- a/lib/features/common/packages/bluetooth/blueberry_ring/utils/utils.dart +++ b/lib/features/common/packages/bluetooth/blueberry_ring/utils/utils.dart @@ -1,4 +1,3 @@ export 'blueberry_configs.dart'; export 'blueberry_commands_utils.dart'; export 'blueberry_ring_data_analyzer.dart'; -export 'date_utils.dart'; diff --git a/packages/shared b/packages/shared index 640be29a..06b24fe8 160000 --- a/packages/shared +++ b/packages/shared @@ -1 +1 @@ -Subproject commit 640be29af4f2499486bed88cd75ee4bc67c5a689 +Subproject commit 06b24fe827d5aebfce5fa8d795da601b2e8dd8fb