Sitecore current date in preview mode

To access the currently selected DateTime in the content editor’s preview mode, instead of checking the query string, use

Also, be sure to check if the page is in preview mode first. In my case, I had a presentation that changed based on the date, but wanted the content authors to be able to preview the presentation using the “Experience” ribbon. This allows for easier past/future page viewing without having to change the system date. This did the trick:

This entry was posted in it and tagged , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>