This is a migrated thread and some comments may be shown as answers.
Unrepresentable DateTime
9 Answers 66 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Shane
Top achievements
Rank 1
Shane asked on 31 Jul 2011, 11:49 PM
Hello,

This literally started happening at midnight last night.

Our MVC calendar shows dates loaded from a database in the format dd/MM/yyyy. This has been working fine for months.. and today, 1st of August (1/08/2011) it has just suddenly decided to stop working (and is now throwing the unrepresentable DateTime exception).

How can I force the date format? Or why would this be happening all of a sudden?

Regards,

Shane

9 Answers, 1 is accepted

Sort by
0
Shane
Top achievements
Rank 1
answered on 31 Jul 2011, 11:51 PM
UPDATE:

I have removed everything from our database for the calendar.. which makes me think that the issue is with the calendar itself when it attempts to navigate to the current month.

Any help with this would be greatly appreciated.

Shane
0
Georgi Krustev
Telerik team
answered on 01 Aug 2011, 08:30 AM
Hello Shane,

 
Unfortunately this is not a known issue. Could you please elaborate more on this? Can you share with us some code snippets which helps to replicate the issue. A simple test project which can run locally will be really helpful.

Regards,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

0
AccMan
Top achievements
Rank 1
answered on 01 Aug 2011, 10:08 AM
We have the exact same issue you experience Shane! It works if we set the system date to 31/07/2011 and fails for 01/08/2011, 02/08/2011, ...

 @{Html.Telerik().Calendar()
                .Name("main-calendar")
                .Value(DateTime.Now)
                .Render(); }

The Render() method makes it fail.
0
Georgi Krustev
Telerik team
answered on 01 Aug 2011, 10:20 AM
Hello,

 
Here is a screen-cast which shows that everything is fine on my end. Please let me know if I am missing something.

Best regards,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

0
AccMan
Top achievements
Rank 1
answered on 01 Aug 2011, 10:26 AM

Our Telerik version : 2011.1.315.340 ... we are testing the latest to see what happens with it.


Server Error in '/' Application.

Year, Month, and Day parameters describe an un-representable DateTime.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.

Source Error:

Line 134:
Line 135:    <div class="main-date-panel">
Line 136:            @{Html.Telerik().Calendar()
Line 137:                .Name("main-calendar")
Line 138:                .Value(DateTime.Now)

Source File: X\MasterLayout.cshtml    Line: 136

Stack Trace:

[ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime.]
   System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day) +9390434
   System.DateTime..ctor(Int32 year, Int32 month, Int32 day) +18
   Telerik.Web.Mvc.UI.Calendar.BuildMonthView(ICalendarHtmlBuilder renderer) +515
   Telerik.Web.Mvc.UI.Calendar.WriteHtml(HtmlTextWriter writer) +301
   Telerik.Web.Mvc.UI.ViewComponentBase.Render() +131
   Telerik.Web.Mvc.UI.ViewComponentBuilderBase`2.Render() +55
   ASP._Page_Views_Shared_MasterLayout_cshtml.Execute() in X\MasterLayout.cshtml:136
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
   System.Web.Mvc.WebViewPage.ExecutePageHierarchy() +81
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +88
   System.Web.WebPages.<>c__DisplayClass7.<RenderPageCore>b__6(TextWriter writer) +102
   System.Web.WebPages.HelperResult.WriteTo(TextWriter writer) +12
   System.Web.WebPages.WebPageBase.Write(HelperResult result) +67
   System.Web.WebPages.WebPageBase.RenderSurrounding(String partialViewName, Action`1 body) +66
   System.Web.WebPages.WebPageBase.PopContext() +262
   System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage) +95
   System.Web.Mvc.RazorView.RenderView(ViewContext viewContext, TextWriter writer, Object instance) +220
   System.Web.Mvc.BuildManagerCompiledView.Render(ViewContext viewContext, TextWriter writer) +115
   System.Web.Mvc.ViewResultBase.ExecuteResult(ControllerContext context) +303
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResult(ControllerContext controllerContext, ActionResult actionResult) +13
   System.Web.Mvc.<>c__DisplayClass1c.<InvokeActionResultWithFilters>b__19() +23
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultFilter(IResultFilter filter, ResultExecutingContext preContext, Func`1 continuation) +260
   System.Web.Mvc.<>c__DisplayClass1e.<InvokeActionResultWithFilters>b__1b() +19
   System.Web.Mvc.ControllerActionInvoker.InvokeActionResultWithFilters(ControllerContext controllerContext, IList`1 filters, ActionResult actionResult) +177
   System.Web.Mvc.ControllerActionInvoker.InvokeAction(ControllerContext controllerContext, String actionName) +343
   System.Web.Mvc.Controller.ExecuteCore() +116
   System.Web.Mvc.ControllerBase.Execute(RequestContext requestContext) +97
   System.Web.Mvc.ControllerBase.System.Web.Mvc.IController.Execute(RequestContext requestContext) +10
   System.Web.Mvc.<>c__DisplayClass11.<ProcessRequest>b__10() +65
   System.Web.Mvc.SecurityUtil.<GetCallInAppTrustThunk>b__0(Action f) +7
   System.Web.Mvc.SecurityUtil.ProcessInApplicationTrust(Action action) +22
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContextBase httpContext) +71
   System.Web.Mvc.MvcHandler.ProcessRequest(HttpContext httpContext) +44
   System.Web.Mvc.MvcHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext httpContext) +10
   System.Web.Mvc.MvcHttpHandler.VerifyAndProcessRequest(IHttpHandler httpHandler, HttpContextBase httpContext) +29
   System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContextBase httpContext) +144
   System.Web.Routing.UrlRoutingHandler.ProcessRequest(HttpContext httpContext) +42
   System.Web.Routing.UrlRoutingHandler.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +10
   Northwind.Web._Default.Page_Load(Object sender, EventArgs e) in X\Default.aspx.cs:12
   System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
   System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
   System.Web.UI.Control.OnLoad(EventArgs e) +91
   System.Web.UI.Control.LoadRecursive() +74
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.225
0
Accepted
AccMan
Top achievements
Rank 1
answered on 01 Aug 2011, 11:11 AM
The latest version doesn't seem to have the issue. But we can't update it yet because we get things not working the same way it did before with the newest Grid component...

For now we're disabling our calendar. The DatePicker component (ours and latest) doesn't seem to have the issue.
0
Georgi Krustev
Telerik team
answered on 01 Aug 2011, 11:19 AM
Hello Jerome,

  
I will suggest you track the latest internal builds. Some of the known issue related with the Grid UI component are already fixed in the latest internal builds.

Regards,
Georgi Krustev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

0
AccMan
Top achievements
Rank 1
answered on 01 Aug 2011, 12:50 PM
It solved our issue. Thanks.
0
Shane
Top achievements
Rank 1
answered on 01 Aug 2011, 10:50 PM
I just upgraded as well and it seems to have fixed the problem.

Regards,

Shane
Tags
Calendar
Asked by
Shane
Top achievements
Rank 1
Answers by
Shane
Top achievements
Rank 1
Georgi Krustev
Telerik team
AccMan
Top achievements
Rank 1
Share this question
or