File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed
lib/app/utils/taskfunctions Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,26 @@ import 'package:taskwarrior/app/utils/app_settings/app_settings.dart';
33import 'package:taskwarrior/app/utils/language/sentence_manager.dart' ;
44
55String dateToStringForAddTask (DateTime dt) {
6- return 'On ${DateFormat ('yyyy-MM-dd' ).format (dt )} at ${DateFormat ('hh:mm:ss' ).format (dt )}' ;
6+ final now = DateTime .now ();
7+ final today = DateTime (now.year, now.month, now.day);
8+ final tomorrow = today.add (const Duration (days: 1 ));
9+ final dtDate = DateTime (dt.year, dt.month, dt.day);
10+
11+ // Format time in 12-hour format with AM/PM
12+ final timeFormat = DateFormat ('h:mm a' );
13+ final timeString = timeFormat.format (dt);
14+
15+ // Check if date is today or tomorrow
16+ if (dtDate == today) {
17+ return 'Today • $timeString ' ;
18+ } else if (dtDate == tomorrow) {
19+ return 'Tomorrow • $timeString ' ;
20+ } else {
21+ // Format: "Feb 28 • 7:50 AM"
22+ final dateFormat = DateFormat ('MMM d' );
23+ final dateString = dateFormat.format (dt);
24+ return '$dateString • $timeString ' ;
25+ }
726}
827
928String getPriorityText (String priority) {
You can’t perform that action at this time.
0 commit comments