Skip to content

Commit

Permalink
Merge pull request #8 from niloysikdar/oxygen
Browse files Browse the repository at this point in the history
Parsed DateTime for posts
  • Loading branch information
niloysikdar authored May 1, 2021
2 parents 7358b5c + 44b610f commit 65dd086
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/screens/showOxygenposts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ class ShowOxygenPosts extends StatelessWidget {
required OxygenPostModel oxygenPostModel,
required Size size,
}) {
DateTime createdOn = DateTime.parse(oxygenPostModel.postedOn);
String timestring =
"${createdOn.day.toString().padLeft(2, '0')}/${createdOn.month.toString().padLeft(2, '0')}/${createdOn.year.toString()}, ${createdOn.hour.toString()}:${createdOn.minute.toString()}";
return Container(
margin: EdgeInsets.all(20),
padding: EdgeInsets.all(20),
Expand Down Expand Up @@ -95,7 +98,7 @@ class ShowOxygenPosts extends StatelessWidget {
),
SizedBox(height: 10),
Text(
"30/07/2001 -by Admin",
"$timestring -by ${oxygenPostModel.postedBy}",
style: TextStyle(
color: kelectronBlue,
fontSize: 18,
Expand All @@ -104,7 +107,7 @@ class ShowOxygenPosts extends StatelessWidget {
),
SizedBox(height: 3),
Text(
"Role: Admin",
"Role: ${oxygenPostModel.postedRole}",
style: TextStyle(
color: Colors.grey[800],
fontSize: 18,
Expand Down

0 comments on commit 65dd086

Please sign in to comment.