summaryrefslogtreecommitdiff
path: root/Juick/ViewModels
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2013-04-23 13:33:55 +0400
committerGravatar Vitaly Takmazov2013-04-23 13:33:55 +0400
commitb18cc65cc80d1f21b47f6ad25a673adbaeab6084 (patch)
treea59fadf133e05c4f049f75ce378fce12b57e733c /Juick/ViewModels
parent83ea4b07788df8d5da9286372ca9bdf76b5513fd (diff)
Prettify datetime output
Diffstat (limited to 'Juick/ViewModels')
-rw-r--r--Juick/ViewModels/PostItem.cs9
1 files changed, 7 insertions, 2 deletions
diff --git a/Juick/ViewModels/PostItem.cs b/Juick/ViewModels/PostItem.cs
index 97935b3..88f6b86 100644
--- a/Juick/ViewModels/PostItem.cs
+++ b/Juick/ViewModels/PostItem.cs
@@ -1,6 +1,8 @@
using System;
using System.Net;
using JuickApi;
+using Juick.Classes;
+using System.Globalization;
namespace Juick.ViewModels
{
@@ -11,8 +13,11 @@ namespace Juick.ViewModels
MID = message.Mid;
RID = message.Rid;
Username = message.User.UName;
- Status = string.Format("Posted on: {0}, replies: {1}", message.Timestamp, message.Replies);
-
+ // Juick timestamp in utc: 2013-04-22 13:14:30
+ var timestamp = DateTime.ParseExact(message.Timestamp, "yyyy-MM-dd HH:mm:ss", null);
+ Status = string.Format("{0}", DateHelper.PrettyDate(timestamp.ToLocalTime()));
+ if (message.Replies > 0)
+ Status = string.Format("{0}, replies: {1}", Status, message.Replies);
MessageText = HttpUtility.HtmlDecode(message.Body);
if (message.Tags != null)