Skip to content

Commit

Permalink
Improve date formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ivirtex committed Oct 25, 2023
1 parent 7b697d6 commit 576dd89
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions lib/launches/widgets/launch_card.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,38 @@ class LaunchCard extends StatelessWidget {
launch.name,
style: Theme.of(context).textTheme.titleMedium,
),
Text(
formatDate(
launch.net?.toLocal(),
dateFormat: DateFormat.yMMMd().add_Hm(),
) ??
'N/A',
style: Theme.of(context).textTheme.titleSmall!.copyWith(
color: Theme.of(context).colorScheme.outline,
const SizedBox(height: 5),
RichText(
text: TextSpan(
children: [
TextSpan(
text: formatDate(
launch.net?.toLocal(),
dateFormat: DateFormat.yMMMd(),
) ??
'N/A',
style: TextStyle(
color: Theme.of(context).colorScheme.tertiary,
),
),
TextSpan(
text: ' • ',
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
),
),
TextSpan(
text: formatDate(
launch.net?.toLocal(),
dateFormat: DateFormat.Hm(),
) ??
'N/A',
style: TextStyle(
color: Theme.of(context).colorScheme.outline,
),
),
],
),
),
const SizedBox(height: 5),
Text(
Expand Down

0 comments on commit 576dd89

Please sign in to comment.