More in this section

Forums / Bugs & Issues / Modifying publication and created dates of news

Modifying publication and created dates of news

2 posts, 0 answered
  1. Isa
    Isa avatar
    3 posts
    Registered:
    09 Mar 2012
    20 Mar 2012
    Link to this post
    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.
  2. Grace Hallwachs
    Grace Hallwachs avatar
    144 posts
    Registered:
    03 Nov 2014
    23 Mar 2012
    Link to this post
    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
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered