Controlled separation dating

Then on each edit of the display input, the extension traps the change event, and overrwrites the hidden base model input as per the desired save format.The other good thing is, that the extension automatically triggers the javascript change event for the base model input as well.Thus all client model validations and other jquery events needed by Picker widgets are automatically triggered.

controlled separation dating-7

Most Yii developers or users almost always need an option of displaying date and time in ONE specific format, but save them to database in ANOTHER format. This was still an issue when one had many models and views in the application and changes in development cycle, had to be replicated in many places (more complex scenarios being multi-regional formats).

This module helps overcome this large gap by addressing all of these at the presentational level.

The module enables one to configure the date and time settings separately for DISPLAY and SAVE.

This can be setup either globally or individually at each Date Control widget level.

And if this is not useful enough, it automatically enables any date/time picker widgets to be used in conjunction with this.

How this magic works, is that the extension just alters this at the presentational layer (VIEW).

It automatically sets the base model input to hidden and displays a mirror input in the display format one has set.

The Date Control module allows controlling date formats of attributes separately for View and Model for Yii Framework 2.0.

It thus allows an easy way to work with dates when displaying to users in one way (format / timezone) but saving it in the database in another way (format / timezone). This release now adds supports for both ICU and PHP date format patterns.

By default the format will be parsed as a ICU date pattern.

In order to pass a PHP Date format - prepend your format pattern with the string When working with the great Yii Framework, one of the most common observations I had was the need to have a proper control on the date settings.

Comments are closed.