[blam] ItemView: Also check for date in LastUpdatedTime
- From: Carlos Martín Nieto <cmartin src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [blam] ItemView: Also check for date in LastUpdatedTime
- Date: Mon, 7 Feb 2011 21:43:01 +0000 (UTC)
commit ffc8119487b664da9e843577897096f0008ad7fb
Author: Carlos MartÃn Nieto <carlos cmartin tk>
Date: Mon Feb 7 22:36:36 2011 +0100
ItemView: Also check for date in LastUpdatedTime
Some feeds (*cough* monologue *cough*) don't have a published time but
only an "updated" time. When Setting the date string, prefer the
updated time to the published time.
Also get the "[No date available]" string from the catalog.
src/ItemView.cs | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/ItemView.cs b/src/ItemView.cs
index 20dc6ba..204ba01 100644
--- a/src/ItemView.cs
+++ b/src/ItemView.cs
@@ -105,9 +105,14 @@ namespace Imendio.Blam {
author = " ";
}
string link = Catalog.GetString("Show in browser");
- string pubdate = (!currentItem.PublishDate.Equals(DateTimeOffset.MinValue)) ?
- currentItem.PublishDate.ToString("D", System.Globalization.CultureInfo.CurrentUICulture) : " ";
- string text = HtmlUtils.EncodeUnicode(HtmlUtils.FixMarkup((currentItem.exposed_text as TextSyndicationContent).Text));
+ string pubdate = (!currentItem.LastUpdatedTime.Equals(DateTimeOffset.MinValue)) ?
+ currentItem.LastUpdatedTime.ToString("D", System.Globalization.CultureInfo.CurrentUICulture) :
+ (!currentItem.PublishDate.Equals(DateTimeOffset.MinValue)) ?
+ currentItem.PublishDate.ToString("D", System.Globalization.CultureInfo.CurrentUICulture) :
+ Catalog.GetString("[No date available]");
+ TextSyndicationContent cont = currentItem.exposed_text as TextSyndicationContent;
+ string text = cont.Text;
+ //string text = (currentItem.exposed_text as TextSyndicationContent).Text;
string title = HtmlUtils.Escape(currentItem.Title.Text);
string url = currentItem.Links[0].Uri.ToString();
baseDir = "file://" + theme.Path;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]