This is a migrated thread and some comments may be shown as answers.

Advanced Form Insert - Date Format?

4 Answers 165 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Kevin Flynn
Top achievements
Rank 1
Kevin Flynn asked on 08 Feb 2010, 02:30 PM
I'm getting the following error when clicking the "Options" button when trying to insert a new appointment:

"Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: The DateTime represented by the string is not supported in calendar System.Globalization.GregorianCalendar"

This doesn't happen in a small test project I put together but happens when I put the calendar into our application.  Here's the parameter string I get during the postback just before the error occurs.  I believe the startDate and endDate is formatted improperly and something in our application is causing this problem.  I'm trying to insert and appointment on February 23rd.  Notice the start date is 2010 0023 0002.  It should be 2010 0223 0000.  I.e., the day/month should be the middle 4 digits, the time is the last 4 digits.

"command":"AdvancedInsert",
"appointment":
{
"Subject":"",
"Description":"",
"Resources":[],
"RecurrenceState":0},
"startDate":"201000230002",
"endDate":"201000240002"
}

Any idea's what's causing this or how to fix it?

Thanks.

Kevin

4 Answers, 1 is accepted

Sort by
0
T. Tsonev
Telerik team
answered on 11 Feb 2010, 11:45 AM
Hello Kevin,

Thank you for the detailed description of the problem. Here's how we get the date string:

appointment.get_start().format('yyyyMMddHHmm')

According to the format function reference this should produce consistent results for any culture. In your case the "mm" and "MM" parts swap their meanings.

This looks like a bug in the MS AJAX framework and we'll do our best to fix it. Can you please tell us what is the Page culture of the application, so we can reproduce it here?

Best wishes,
Tsvetomir Tsonev
the Telerik team

Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Follow the status of features or bugs in PITS and vote for them to affect their priority.
0
Kevin Flynn
Top achievements
Rank 1
answered on 11 Feb 2010, 03:55 PM
US English.

After a bit more digging, I've noticed this is only a problem in IE 7 & IE 8.  It works fine in Firefox and Safari.

Please note, this behavior only occurs in our application.  I have a small demo project that performs as expected. I'm guessing there's something in our application that's causing this issue.
0
Kevin Flynn
Top achievements
Rank 1
answered on 11 Feb 2010, 04:18 PM
Is there a method I can use to set the format info to the way it should be?
0
Kevin Flynn
Top achievements
Rank 1
answered on 11 Feb 2010, 05:26 PM
False alarm.  Thought it was fixed by setting the culture property on the control itself.  Didn't work.

Now, it's fixed.  Our application was including a "global" javascript file using the following method:

 

<asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release">

 

 

<Scripts>

 

 

   <asp:ScriptReference Path="../js/Utils.js" />

 

 

</Scripts>

 

 

</asp:ScriptManager>

I changed this to <script type="text/javascript" src="../js/Utils.js"></script> and located it in the header section of the page.

All is well. Except for really knowing why this was causing the problem, that is.

Thanks for the help.

 

Tags
Scheduler
Asked by
Kevin Flynn
Top achievements
Rank 1
Answers by
T. Tsonev
Telerik team
Kevin Flynn
Top achievements
Rank 1
Share this question
or