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
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