DateTime Picker giving Error for few TimeZones

4 posts, 0 answers
  1. Richard Noons
    Richard Noons avatar
    5 posts
    Member since:
    Aug 2008

    Posted 06 Apr 2015 Link to this post

    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

  2. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 08 Apr 2015 Link to this post

    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.

     
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Richard
    Richard avatar
    9 posts
    Member since:
    Feb 2014

    Posted 22 Jan in reply to Richard Noons Link to this post

    Did you ever resolve this? I have the same issue and seems to be related to the use of time
  5. Maria Ilieva
    Admin
    Maria Ilieva avatar
    4017 posts

    Posted 27 Jan Link to this post

    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
Back to Top