More blog post published date cleanup WRT Live Writer

--HG--
branch : dev
This commit is contained in:
Nathan Heskew
2010-12-14 13:44:14 -08:00
parent 7113067437
commit f40a725c33
4 changed files with 6 additions and 31 deletions

View File

@@ -18,8 +18,8 @@ namespace Orchard.Core.XmlRpc.Services {
{typeof(bool), p=>new XElement("boolean", (bool)p.Value?"1":"0")},
{typeof(string), p=>new XElement("string", p.Value)},
{typeof(double), p=>new XElement("double", (double)p.Value)},
{typeof(DateTime), p=>new XElement("dateTime.iso8601", ((DateTime)p.Value).ToString("yyyy-MM-ddTHH:mm:ssZ"))},
{typeof(DateTime?), p=>new XElement("dateTime.iso8601", ((DateTime?)p.Value).Value.ToString("yyyy-MM-ddTHH:mm:ssZ"))},
{typeof(DateTime), p=>new XElement("dateTime.iso8601", ((DateTime)p.Value).ToString("yyyyMMddTHH:mm:ssZ"))},
{typeof(DateTime?), p=>new XElement("dateTime.iso8601", ((DateTime?)p.Value).Value.ToString("yyyyMMddTHH:mm:ssZ"))},
{typeof(byte[]), p=>new XElement("base64", Convert.ToBase64String((byte[])p.Value))},
{typeof(XRpcStruct), p=>Map((XRpcStruct)p.Value)},
{typeof(XRpcArray), p=>Map((XRpcArray)p.Value)},

View File

@@ -51,7 +51,7 @@ namespace Orchard.Blogs.Handlers {
OnCreated<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
OnPublished<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
OnUnpublished<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
OnVersioned<BlogPostPart>((context, bp1, bp2) => updateBlogPostCount(bp2.BlogPart));
OnVersioned<BlogPostPart>((context, bp1, bp2) => updateBlogPostCount(bp1.BlogPart));
OnRemoved<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
OnRemoved<BlogPart>(

View File

@@ -51,33 +51,8 @@ namespace Orchard.Blogs.Models {
}
}
public DateTime? CreatedUtc {
get { return this.As<ICommonPart>().CreatedUtc; }
}
public DateTime? ScheduledPublishUtc { get; set; }
private string _scheduledPublishUtcDate;
public string ScheduledPublishUtcDate
{
get {
return !HasPublished && !string.IsNullOrEmpty(_scheduledPublishUtcDate) || !ScheduledPublishUtc.HasValue
? _scheduledPublishUtcDate
: ScheduledPublishUtc.Value.ToShortDateString();
}
set { _scheduledPublishUtcDate = value; }
}
private string _scheduledPublishUtcTime;
public string ScheduledPublishUtcTime {
get {
return !HasPublished && !string.IsNullOrEmpty(_scheduledPublishUtcTime) || !ScheduledPublishUtc.HasValue
? _scheduledPublishUtcTime
: ScheduledPublishUtc.Value.ToShortTimeString();
}
set { _scheduledPublishUtcTime = value; }
public DateTime? PublishedUtc {
get { return this.As<ICommonPart>().PublishedUtc; }
}
}
}

View File

@@ -294,7 +294,7 @@ namespace Orchard.Blogs.Services {
var url = urlHelper.AbsoluteAction(() => urlHelper.BlogPost(blogPostPart));
return new XRpcStruct()
.Set("postid", blogPostPart.Id)
.Set("dateCreated", blogPostPart.CreatedUtc)
.Set("dateCreated", blogPostPart.PublishedUtc)
.Set("title", blogPostPart.Title)
.Set("wp_slug", blogPostPart.Slug)
.Set("description", blogPostPart.Text)