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

Calendar always picking current date

1 Answer 28 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Ayaz Anwar
Top achievements
Rank 1
Ayaz Anwar asked on 11 Aug 2009, 05:30 AM
I am using Telerik Calendar control and setting Current Culture on ASP.NET page using following code

System.Threading.Thread.CurrentThread.CurrentCulture = new GCAACulture(System.Threading.Thread.CurrentThread.CurrentCulture.Name);
System.Threading.Thread.CurrentThread.CurrentCulture.DateTimeFormat.DateSeparator = " ";

public class GCAACulture : CultureInfo
    {
       public GCAACulture(string cultureName) : base(cultureName)
       {
          this.DateTimeFormat = new System.Globalization.DateTimeFormatInfo();
          this.DateTimeFormat.ShortDatePattern = "dddd, dd MMMM yyyy";
          this.DateTimeFormat.LongDatePattern = "dddd, dd MMMM yyyy";
       }
    }


But whenever I select date using date picker popup always current day is selected. When I debug the telerik javascript code then I found that code fails to parse of day of selected dated and as result it selected current (Today) date as an alternate. The day part of selected date returning null value.

While debugging I  found that something is wrong in following method.

parseDate:function(_fe,_ff){
try{
var _100=new Telerik.Web.UI.DateParsing.DateTimeLexer(this.get_dateFormatInfo());
var _101=_100.GetTokens(_fe);
var _102=new Telerik.Web.UI.DateParsing.DateTimeParser(this.get_dateFormatInfo().TimeInputOnly);
var _103=_102.Parse(_101);
_ff=this._getParsingBaseDate(_ff);
var date=_103.Evaluate(_ff,this.get_dateFormatInfo());
return date;
}




Please help me from where I am making mistake.

Regards
Ayaz Anwar
Software Engineer

1 Answer, 1 is accepted

Sort by
0
Pavel
Telerik team
answered on 13 Aug 2009, 07:40 AM
Hi Ayaz,

We have replied to you in the other thread where you ask the same question.

http://www.telerik.com/community/forums/aspnet-ajax/calendar/javascript-error-this-slots-month-is-null-or-not-an-object.aspx

Sincerely yours,
Pavel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Calendar
Asked by
Ayaz Anwar
Top achievements
Rank 1
Answers by
Pavel
Telerik team
Share this question
or