Skip to content

Commit

Permalink
summary date fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mdmohsin7 committed Sep 28, 2024
1 parent 2fe5a4e commit 3e0f72e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions app/lib/pages/chat/widgets/ai_message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@ Widget buildMessageWidget(ServerMessage message, Function(String) sendMessage, b
updateMemory: updateMemory,
);
} else if (message.type == MessageType.daySummary) {
return DaySummaryWidget(showTypingIndicator: showTypingIndicator, messageText: message.text);
return DaySummaryWidget(
showTypingIndicator: showTypingIndicator, messageText: message.text, date: message.createdAt);
} else if (displayOptions) {
return InitialMessageWidget(
showTypingIndicator: showTypingIndicator, messageText: message.text, sendMessage: sendMessage);
Expand Down Expand Up @@ -171,8 +172,9 @@ class InitialMessageWidget extends StatelessWidget {

class DaySummaryWidget extends StatelessWidget {
final bool showTypingIndicator;
final DateTime date;
final String messageText;
const DaySummaryWidget({super.key, required this.showTypingIndicator, required this.messageText});
const DaySummaryWidget({super.key, required this.showTypingIndicator, required this.messageText, required this.date});

@override
Widget build(BuildContext context) {
Expand All @@ -181,7 +183,7 @@ class DaySummaryWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'📅 Day Summary ~ ${dateTimeFormat('MMM, dd', DateTime.now())}',
'📅 Day Summary ~ ${dateTimeFormat('MMM, dd', date)}',
style: TextStyle(
fontSize: 18,
fontWeight: FontWeight.w500,
Expand Down

0 comments on commit 3e0f72e

Please sign in to comment.