Modifying publication and created dates of news
Hello teleric team. I started using sitefinity CMS a week ago. And I cant change the publication and created dates of the news item to back date, using next code:
var Item = App.WorkWith().NewsItems().Where(nI => nI.Title.ToString() == "isa")
//"isa" - title of my news item
.ForEach(nI =>
var val = DateTime.Parse(NewDate.Text);
nI.PublicationDate = val;
nI.DateCreated = val;
).SaveChanges();
And I got this: Exception has been thrown by the target of an invocation. Please, help me.
Hi,
If you wish to change news publication back date, I would suggest taking a look at this blog post. This should guide in you in changing the news date.
Please let us know if you have anymore questions.
Kind regards,
Grace Hallwachs
the Telerik team