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

DateTime Picker giving Error for few TimeZones

3 Answers 196 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Phani Kumar
Top achievements
Rank 1
Phani Kumar asked on 06 Apr 2015, 05:21 AM

Hi,

 I am using two DateTime Picker (set to BOTH Date&Time) and when I am trying to retrieve data from database, it is throwing an exception. From event viewer, I got this :
Stack trace:    at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day)
   at System.DateTime..ctor(Int32 year, Int32 month, Int32 day)
   at Telerik.Web.UI.Calendar.Utils.Utility.ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, String inputString) in c:\Users\Administrator\Desktop\UI for ASP.NET AJAX\Telerik.Web.UI_2013_2_717_Source\RadControlsAjaxSource\Telerik.Web.UI\Calendar\Utility\Utility.cs:line 274
   at Telerik.Web.UI.RadCalendar.LoadPostData(String postDataKey, NameValueCollection postCollection) in c:\Users\Administrator\Desktop\UI for ASP.NET AJAX\Telerik.Web.UI_2013_2_717_Source\RadControlsAjaxSource\Telerik.Web.UI\Calendar\RadCalendar.cs:line 5041
   at Telerik.Web.UI.RadWebControl.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) in c:\Users\Administrator\Desktop\UI for ASP.NET AJAX\Telerik.Web.UI_2013_2_717_Source\RadControlsAjaxSource\Telerik.Web.UI\Common\RadWebControl.cs:line 742
   at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
   at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

 

  •  We are UI for ASP.Net AJAX (Telerik version 2013.2.717.35).
  • It is working fine for few TimeZone like Pacific Time but giving error in like UTC +5.30 etc.
  • The error is only occurring when we are setting it to both (Date & Time ) while it is working fine in only Date Format.

 

I tried Debugging into Telerik Source, and I found that the exception is coming in this funtion:

/// <summary>
/// Converts an input 2D JavaScript array like [[5,10,2005],[6,10,2005],[7,10,2005]] into a DateTimeCollection.
/// </summary>
/// <param name="dateTimeCollection">The DateTimeCollection that will be filled.</param>
/// <param name="inputString">The input string.</param>
internal static void ConvertToServerDateTimeCollection(DateTimeCollection dateTimeCollection, string inputString)
{
int i, BracketCount = 0;

if (String.IsNullOrEmpty(inputString)) return;

for (i = 0; i < inputString.Length; i++)
{
if (inputString[i] == '[')
BracketCount++;
else if (inputString[i] == ']')
BracketCount--;
}
if (BracketCount != 0)
{
throw new FormatException(Constants.Exception.FormatInputJavaScriptDateException);
}

// Remove the "[" and the "]"
inputString = inputString.Replace("[", String.Empty).Replace("]", String.Empty);

string[] ArrDates = inputString.Split(",".ToCharArray());

for (i = 0; i < ArrDates.Length / 3; i++)
{
DateTime CurrentDateTime = new DateTime(Int32.Parse(ArrDates[i * 3]), Int32.Parse(ArrDates[i * 3 + 1]), Int32.Parse(ArrDates[i * 3 + 2]));
dateTimeCollection.Add(new RadDate(CurrentDateTime));
}
}

 

Please suggest some way to get rid from this problem. 

Thanks

3 Answers, 1 is accepted

Sort by
0
Maria Ilieva
Telerik team
answered on 08 Apr 2015, 01:06 PM
Hello Man,

Can you please share your full page markup and related code behind so that we can further research on your exact scenario and do our best to isolate the root cause of the issue?

Regards,
Maria Ilieva
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Richard
Top achievements
Rank 1
answered on 22 Jan 2016, 08:00 PM
Did you ever resolve this? I have the same issue and seems to be related to the use of time
0
Maria Ilieva
Telerik team
answered on 27 Jan 2016, 01:13 PM
Hi Richard,

This case haven't been further researched as we haven't received more information on it. Can you please open  a separate thread and provide as much information as you can that is relevant to this case and to its replication so that we can further investigate it locally and do our best to rpovide proper solution?

Regards,
Maria Ilieva
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
Calendar
Asked by
Phani Kumar
Top achievements
Rank 1
Answers by
Maria Ilieva
Telerik team
Richard
Top achievements
Rank 1
Share this question
or