behrang / Ext.ux.JalaliDatePlugin

An ExtJS plugin for DatePicker, DateMenu and DateField.
12 stars 3 forks source link

problem using this plugin with ext.net 2.2 #3

Closed alibahal closed 11 years ago

alibahal commented 11 years ago

Hi. I'm using this plugin with ext.net v2.2. it show Persian date correctly and i can select a date, but the value of this field on server side always is " 1/1/0001 12:00:00 AM ".

can you fix this problem?

behrang commented 11 years ago

I think the problem is with your application. This plugin does not change the value of DateField. So it is a Date object. You have to convert it before sending it to your server. Either send a number (milliseconds since epoch) or an ISO formatted date string. Then on your server convert that field and use it. You can also convert that Date object to a Jalali String, before sending it to your server.

alibahal commented 11 years ago

when i use use ext:DateField without your plugin, i can get the selected date value on server side with "SelectedDate" property of this field. but when add your plugin to my code this value return " 1/1/0001 12:00:00 AM ". and by the way I'm using asp.net.

behrang commented 11 years ago

Ok, it may be a problem of this plugin. Please help in solving it. Unfortunately I can't help you with .NET. I reopen this issue.

alibahal commented 11 years ago

OK, I want to help in solving this issue. can you please tell me which is the last function that runs in the "JalaliDatePlugin.js " and update this control text and selected date? thank you in advance

behrang commented 11 years ago

I think it's better to start by looking at what is being sent to the server. Use the chrome developer tools network tab and check what is being sent to the server for 2 different dates.

alibahal commented 11 years ago

OK, I checked the Sent value with Fiddler, and the value was correct. hence I review the ext.net code and the problem was their and I fix this issue with ext.net.But still there is a problem. when I set the field value on server side, this plugin does not convert this value to Jalali date on client side and show the Georgian date vale on client. where can i look for this bug?

behrang commented 11 years ago

I think you have to set the default value in Jalali format. You have to convert Gregorian date to Jalali. On the client, You can use Ext.Date.format function. On the server you have to convert it with a .NET conversion utility. I close this issue.