kartik-v / yii2-datecontrol

Date control module allowing separation of date formats for View & Model for Yii Framework 2.0.
http://demos.krajee.com/datecontrol
Other
55 stars 29 forks source link

convert action is taking long to change hidden field value #92

Closed aidonsnous closed 7 years ago

aidonsnous commented 8 years ago

I tested this by change the time using the incrementer;when I submit I the value that was submitted was the previous; It also happens when you quickly and successivly select value(date or time using the control). previous displayed value:12:00:00 and current displayed value: 15:00:00 By the time the current value is being send to the server to process and modify the 12:00:00 I submitted already the form which made the value to not change in the database.

There should be a code to make the submission wait until the value is back from the server or submit the displayed value and process it using behaviour or init.

Enrica-r commented 7 years ago

If you don't need to change timezone from a display time zone to a save time zone then you could use Javascript version instead of AJAX call. Just set the property ajaxConversion to false.

Time zone conversion makes sense with 'datetime' controls only. (see issuel #96 and #102 )

I don't know exactly how to suppress form submit during ajax call. Probably be disabling the submit button within Javascript. Probably Kartik has an idea.

kartik-v commented 7 years ago

This can be handled via events.. will include a small enhancement.

kartik-v commented 7 years ago

This has been resolved... Your use case can be achieved for example by the following steps

The above events can be triggered using pluginEvents within DateControl widget