mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
More blog post published date cleanup WRT Live Writer
--HG-- branch : dev
This commit is contained in:
@@ -18,8 +18,8 @@ namespace Orchard.Core.XmlRpc.Services {
|
|||||||
{typeof(bool), p=>new XElement("boolean", (bool)p.Value?"1":"0")},
|
{typeof(bool), p=>new XElement("boolean", (bool)p.Value?"1":"0")},
|
||||||
{typeof(string), p=>new XElement("string", p.Value)},
|
{typeof(string), p=>new XElement("string", p.Value)},
|
||||||
{typeof(double), p=>new XElement("double", (double)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).ToString("yyyyMMddTHH: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).Value.ToString("yyyyMMddTHH:mm:ssZ"))},
|
||||||
{typeof(byte[]), p=>new XElement("base64", Convert.ToBase64String((byte[])p.Value))},
|
{typeof(byte[]), p=>new XElement("base64", Convert.ToBase64String((byte[])p.Value))},
|
||||||
{typeof(XRpcStruct), p=>Map((XRpcStruct)p.Value)},
|
{typeof(XRpcStruct), p=>Map((XRpcStruct)p.Value)},
|
||||||
{typeof(XRpcArray), p=>Map((XRpcArray)p.Value)},
|
{typeof(XRpcArray), p=>Map((XRpcArray)p.Value)},
|
||||||
|
@@ -51,7 +51,7 @@ namespace Orchard.Blogs.Handlers {
|
|||||||
OnCreated<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
|
OnCreated<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
|
||||||
OnPublished<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
|
OnPublished<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
|
||||||
OnUnpublished<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<BlogPostPart>((context, bp) => updateBlogPostCount(bp.BlogPart));
|
||||||
|
|
||||||
OnRemoved<BlogPart>(
|
OnRemoved<BlogPart>(
|
||||||
|
@@ -51,33 +51,8 @@ namespace Orchard.Blogs.Models {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DateTime? CreatedUtc {
|
public DateTime? PublishedUtc {
|
||||||
get { return this.As<ICommonPart>().CreatedUtc; }
|
get { return this.As<ICommonPart>().PublishedUtc; }
|
||||||
}
|
|
||||||
|
|
||||||
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; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -294,7 +294,7 @@ namespace Orchard.Blogs.Services {
|
|||||||
var url = urlHelper.AbsoluteAction(() => urlHelper.BlogPost(blogPostPart));
|
var url = urlHelper.AbsoluteAction(() => urlHelper.BlogPost(blogPostPart));
|
||||||
return new XRpcStruct()
|
return new XRpcStruct()
|
||||||
.Set("postid", blogPostPart.Id)
|
.Set("postid", blogPostPart.Id)
|
||||||
.Set("dateCreated", blogPostPart.CreatedUtc)
|
.Set("dateCreated", blogPostPart.PublishedUtc)
|
||||||
.Set("title", blogPostPart.Title)
|
.Set("title", blogPostPart.Title)
|
||||||
.Set("wp_slug", blogPostPart.Slug)
|
.Set("wp_slug", blogPostPart.Slug)
|
||||||
.Set("description", blogPostPart.Text)
|
.Set("description", blogPostPart.Text)
|
||||||
|
Reference in New Issue
Block a user