mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-09-23 21:13:35 +08:00
Use the xxxTxxxZ format for date fields in import/export.
--HG-- branch : dev
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Orchard.ContentManagement;
|
||||
using System.Xml;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
using Orchard.Core.Common.Models;
|
||||
@@ -131,9 +132,18 @@ namespace Orchard.Core.Common.Drivers {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Container", containerIdentity.ToString());
|
||||
}
|
||||
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("CreatedUtc", part.CreatedUtc);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("PublishedUtc", part.PublishedUtc);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("ModifiedUtc", part.ModifiedUtc);
|
||||
if (part.CreatedUtc != null) {
|
||||
context.Element(part.PartDefinition.Name)
|
||||
.SetAttributeValue("CreatedUtc", XmlConvert.ToString(part.CreatedUtc.Value, XmlDateTimeSerializationMode.Utc));
|
||||
}
|
||||
if (part.PublishedUtc != null) {
|
||||
context.Element(part.PartDefinition.Name)
|
||||
.SetAttributeValue("PublishedUtc", XmlConvert.ToString(part.PublishedUtc.Value, XmlDateTimeSerializationMode.Utc));
|
||||
}
|
||||
if (part.ModifiedUtc != null) {
|
||||
context.Element(part.PartDefinition.Name)
|
||||
.SetAttributeValue("ModifiedUtc", XmlConvert.ToString(part.ModifiedUtc.Value, XmlDateTimeSerializationMode.Utc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Orchard.ArchiveLater.Models;
|
||||
using Orchard.ArchiveLater.Services;
|
||||
using Orchard.ArchiveLater.ViewModels;
|
||||
@@ -75,7 +76,11 @@ namespace Orchard.ArchiveLater.Drivers {
|
||||
}
|
||||
|
||||
protected override void Exporting(ArchiveLaterPart part, ExportContentContext context) {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("ScheduledArchiveUtc", part.ScheduledArchiveUtc.Value);
|
||||
var scheduled = part.ScheduledArchiveUtc.Value;
|
||||
if (scheduled != null) {
|
||||
context.Element(part.PartDefinition.Name)
|
||||
.SetAttributeValue("ScheduledArchiveUtc", XmlConvert.ToString(scheduled.Value, XmlDateTimeSerializationMode.Utc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
using System.Xml;
|
||||
using JetBrains.Annotations;
|
||||
using Orchard.Comments.Models;
|
||||
using Orchard.ContentManagement;
|
||||
@@ -19,7 +20,11 @@ namespace Orchard.Comments.Drivers {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("UserName", part.Record.UserName);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Email", part.Record.Email);
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("Status", part.Record.Status.ToString());
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("CommentDateUtc", part.Record.CommentDateUtc.ToString());
|
||||
|
||||
if (part.Record.CommentDateUtc != null) {
|
||||
context.Element(part.PartDefinition.Name)
|
||||
.SetAttributeValue("CommentDateUtc", XmlConvert.ToString(part.Record.CommentDateUtc.Value, XmlDateTimeSerializationMode.Utc));
|
||||
}
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("CommentText", part.Record.CommentText);
|
||||
|
||||
var commentedOn = _contentManager.Get(part.Record.CommentedOn);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Xml;
|
||||
using Orchard.ContentManagement;
|
||||
using Orchard.ContentManagement.Drivers;
|
||||
using Orchard.ContentManagement.Handlers;
|
||||
@@ -84,7 +85,11 @@ namespace Orchard.PublishLater.Drivers {
|
||||
}
|
||||
|
||||
protected override void Exporting(PublishLaterPart part, ExportContentContext context) {
|
||||
context.Element(part.PartDefinition.Name).SetAttributeValue("ScheduledPublishUtc", part.ScheduledPublishUtc.Value);
|
||||
var scheduled = part.ScheduledPublishUtc.Value;
|
||||
if (scheduled != null) {
|
||||
context.Element(part.PartDefinition.Name)
|
||||
.SetAttributeValue("ScheduledPublishUtc", XmlConvert.ToString(scheduled.Value, XmlDateTimeSerializationMode.Utc));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user