CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

JQDatePicker and Jalali calendar idea

by mkarimpour » 28 Sep 2013 11:20

Dear Friends,

I am the person that wrote about Regional.FarsiPersian bug on this component. The bug was the wrong behavior of this component when you set this property to Regional.FarsiPersian. After a few communication with Jorge, I accepted the component behavior and the Jalali calendar added to the IWCGJQSuite package.
For brief, our customers is Persian and works with Jalali calendar not Georgian, it is the main reason for me to be corrected the behavior of this useful component.
Now, I am evaluating whole package to buy and using in our web sector applications, then in my sample, I used this component with Regional.FarsiPersian property. But I see the wrong behavior of the component, but this time is different. I explain the details below:
As we know, This component is for displaying date fields to the user and get the value for them to store to the database related field(Date-Aware mode).
In my fields, the users must see the Jalali calendar and select a date value, but the key note is we works always with Georgian value, it means users only view the date value as Persian(Jalali) and could manipulate it. Finally, the new value selected by user stores in the field as Georgian date.
In the other words, JQDatePicker must use Georgian value ever(Date property) and when it want to show, the Jalali value will be shown. Now user see the Jalali value and select the new one, but when it want to write value to its Date property, it must convert it to Georgian.

If anyone want to store Jalali value in the database, I think this component must use a property for covering two mechanism, a property for example "ViewOnly". For me this property set to True.
Your Sincerely
Mehdy Karimpour
mkarimpour
 
Posts: 77
Joined: 08 Jul 2012 07:21

by Jorge Sousa » 28 Sep 2013 23:59

Hi mkarimpour

Thanks for your post.

You've been helping us a lot in the right-to-left controling.

About

JQDatePicker must use Georgian value ever(Date property) and when it want to show, the Jalali value will be shown. Now user see the Jalali value and select the new one, but when it want to write value to its Date property, it must convert it to Georgian.


Do you think this a feature the any programmer that uses Jalali calendar wants, or it's a particular case for you?

In any case we need to find code to translate jalali to gregorian and vice-versa, are you happen to have any code?

PS: A datetime picker is coming ;)

Best Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by mkarimpour » 29 Sep 2013 05:39

cgdevtools_support wrote:Hi mkarimpour

Thanks for your post.

You've been helping us a lot in the right-to-left controling.

About

JQDatePicker must use Georgian value ever(Date property) and when it want to show, the Jalali value will be shown. Now user see the Jalali value and select the new one, but when it want to write value to its Date property, it must convert it to Georgian.


Do you think this a feature the any programmer that uses Jalali calendar wants, or it's a particular case for you?

In any case we need to find code to translate jalali to gregorian and vice-versa, are you happen to have any code?

PS: A datetime picker is coming ;)

Best Regards


Dear Friend, I think most usage is in my way. If programmers wants to do right way, the way is mine, but it is possible and I see that programmers use Jalali date value like your current component behavior. The view is clear, its must Jalali ever, but the storage may difference. I think with a setting property that named "StoreType" with two values (stGregorian, stJalali), you could cover two different mechanism. For my way this property set to stGregorian, for others set to stJalali. For detecting what type of date value comes from db field, the component could use "StoreType" property. It means when "StoreType" = stGregorian then date value convert to Jalali equivalent for viewing and if "StoreType" = stJalali then date value shown directly without converting.
If you implemented these changes, please rely on me to testing the final functionality (mkarimpour@gmail.com) for approving right behavior.
I have the code that I use in our windows component(PADatePicker and PADBDatePicker) for convert to Gregorian and vice-versa:

function DifferenceOfMS : LongInt;
begin
Result := -466699;
end;

function SlrDateToGregorian(SlrDate: TDateTime): TDateTime;
begin
Result:= SlrDate + DifferenceOfMS;
end;

function GregorianDateToSlr(GregorianDate: TDateTime): TDateTime;
begin
Result:= GregorianDate - DifferenceOfMS;
end;

But about the new component TDateTimePicker that I offered to you, I think it is a critical component and I happy for coming. The important thing that you must consider for this component is "StoreType" property that I wrote above, because this component could have the same problem like TIWCGJQDatePicker when Regional set to FarsiPersian.

But about Right-to-Left in your components. We want to buy your IWCGJQSuite for our web sector, so I am evaluating components. Overall, I am ready to do every test or evaluation of your components, specifically for RTL support.

I saw yesterday a drawing problem with IWCGJQDatePicker when its bind to dataset field and the following properties set:

- Self.JQDatePickerOptions.ShowOn:= dposButton; or Self.JQDatePickerOptions.ShowOn:= dposBoth;
- Self.JQDatePickerOptions.ButtonImage:= 'ico/calendar.png';
- Self.JQDatePickerOptions.ButtonImageOnly:= True; or Self.JQDatePickerOptions.ButtonImageOnly:= False;

In this case, the button was drawing in the bottom of main control or vice-cersa. This situation may occurs when the form shown or when an ajax call did. In other situation, there is no problem yet. Please check it.

Your Sincerely
Mehdy Karimpour
Your Sincerely
Mehdy Karimpour
mkarimpour
 
Posts: 77
Joined: 08 Jul 2012 07:21

by mkarimpour » 02 Nov 2013 10:47

mkarimpour wrote:
cgdevtools_support wrote:Hi mkarimpour

Thanks for your post.

You've been helping us a lot in the right-to-left controling.

About

JQDatePicker must use Georgian value ever(Date property) and when it want to show, the Jalali value will be shown. Now user see the Jalali value and select the new one, but when it want to write value to its Date property, it must convert it to Georgian.


Do you think this a feature the any programmer that uses Jalali calendar wants, or it's a particular case for you?

In any case we need to find code to translate jalali to gregorian and vice-versa, are you happen to have any code?

PS: A datetime picker is coming ;)

Best Regards


Dear Friend, I think most usage is in my way. If programmers wants to do right way, the way is mine, but it is possible and I see that programmers use Jalali date value like your current component behavior. The view is clear, its must Jalali ever, but the storage may difference. I think with a setting property that named "StoreType" with two values (stGregorian, stJalali), you could cover two different mechanism. For my way this property set to stGregorian, for others set to stJalali. For detecting what type of date value comes from db field, the component could use "StoreType" property. It means when "StoreType" = stGregorian then date value convert to Jalali equivalent for viewing and if "StoreType" = stJalali then date value shown directly without converting.
If you implemented these changes, please rely on me to testing the final functionality (mkarimpour@gmail.com) for approving right behavior.
I have the code that I use in our windows component(PADatePicker and PADBDatePicker) for convert to Gregorian and vice-versa:

function DifferenceOfMS : LongInt;
begin
Result := -466699;
end;

function SlrDateToGregorian(SlrDate: TDateTime): TDateTime;
begin
Result:= SlrDate + DifferenceOfMS;
end;

function GregorianDateToSlr(GregorianDate: TDateTime): TDateTime;
begin
Result:= GregorianDate - DifferenceOfMS;
end;

But about the new component TDateTimePicker that I offered to you, I think it is a critical component and I happy for coming. The important thing that you must consider for this component is "StoreType" property that I wrote above, because this component could have the same problem like TIWCGJQDatePicker when Regional set to FarsiPersian.

But about Right-to-Left in your components. We want to buy your IWCGJQSuite for our web sector, so I am evaluating components. Overall, I am ready to do every test or evaluation of your components, specifically for RTL support.

I saw yesterday a drawing problem with IWCGJQDatePicker when its bind to dataset field and the following properties set:

- Self.JQDatePickerOptions.ShowOn:= dposButton; or Self.JQDatePickerOptions.ShowOn:= dposBoth;
- Self.JQDatePickerOptions.ButtonImage:= 'ico/calendar.png';
- Self.JQDatePickerOptions.ButtonImageOnly:= True; or Self.JQDatePickerOptions.ButtonImageOnly:= False;

In this case, the button was drawing in the bottom of main control or vice-cersa. This situation may occurs when the form shown or when an ajax call did. In other situation, there is no problem yet. Please check it.

Your Sincerely
Mehdy Karimpour


Dear Friend,

We are now, your customer with 211130074 id. Could you please implement this feature(StoreType) that I explained in this topic?
I am waiting for your beta release to test the component behavior.

Your Sincerely
Mehdy Karimpour
Your Sincerely
Mehdy Karimpour
mkarimpour
 
Posts: 77
Joined: 08 Jul 2012 07:21

by Jorge Sousa » 02 Nov 2013 16:53

Hi Mehdy

It's not forgotten, it will be availabe soon.

Here we work on a "First In First Out" basis, and we've more customers than we can handle. This makes us work many extra-hours and weekends.

Best Regards
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Jorge Sousa » 04 Nov 2013 18:15

Hi Mehdy

We don't think that we necessarily need to add any property in the component to control this particular situation.

When you set IWCGJQDatePicker.Date, you can convert from gregorian to jalali, and when you get IWCGJQDatePicker.Date you can convert from jalali to gregorian on your side.

And if you use DataLink you can use a calculated field.

Please tell us your thoughts.

With best regards.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58


Return to JQDatePicker

Who is online

Users browsing this forum: No registered users and 3 guests

Contact Us.