diff options
author | Vitaly Takmazov | 2013-04-23 13:33:55 +0400 |
---|---|---|
committer | Vitaly Takmazov | 2013-04-23 13:33:55 +0400 |
commit | b18cc65cc80d1f21b47f6ad25a673adbaeab6084 (patch) | |
tree | a59fadf133e05c4f049f75ce378fce12b57e733c /Juick/ViewModels | |
parent | 83ea4b07788df8d5da9286372ca9bdf76b5513fd (diff) |
Prettify datetime output
Diffstat (limited to 'Juick/ViewModels')
-rw-r--r-- | Juick/ViewModels/PostItem.cs | 9 |
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) |