In the site I'm working on, certain content only appears once a certain date is reached:
public bool IsActive
{
get { return System.DateTime.Now >= this.IssueDate.DateTime; }
}
I want to test this code using the preview mode functionality and the experience bar. However, System.DateTime.Now
always returns the real current date, regardless of preview mode. How do I write this so I can guarantee that the date set in the experience bar is respected, but while in normal mode the page still uses System.DateTime.Now
?
Sitecore version: 6.4.1 rev. 110720
Update: I can't use publishing restrictions because children of this item need to be published and visible before this item appears in the menu that is controlled by this logic.