Last active
July 6, 2016 09:47
-
-
Save soen/5858e7d63c21a46a296c4846aaedcff9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Decompiled with JetBrains decompiler | |
| // Type: Sitecore.Web.WebEditUtil | |
| // Assembly: Sitecore.Kernel, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null | |
| // | |
| // NOTE: This is not the complete implementation, only fractions of the important parts related to the date and time. | |
| // | |
| namespace Sitecore.Web | |
| { | |
| public static class WebEditUtil | |
| { | |
| public static DateTime GetCurrentDate() | |
| { | |
| SiteContext site = Factory.GetSite(WebEditUtil.SiteName); | |
| Assert.IsNotNull((object) site, "Site \"{0}\" not found.", (object) Settings.Preview.DefaultSite); | |
| string cookieValue = WebUtil.GetCookieValue(site.GetCookieKey("sc_date")); | |
| if (string.IsNullOrEmpty(cookieValue)) | |
| return DateTime.UtcNow; | |
| return DateUtil.ToUniversalTime(DateUtil.IsoDateToDateTime(cookieValue)); | |
| } | |
| // code omitted... | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment