Wiki

Articles tagged with "date", sorted by date (updated)X
Displaying 1-9 of 9 result(s).

Behaviour for Time Zone and Format conversion for Date, Time, timestamp, and datetime

Updated about a year ago by SmitheshHow-tos1 comment – viewed 7,972 times – ( +3 ) – version 1.1
This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.

Date Picker by examples

Updated about a year ago by Alfa AdhityaHow-tos6 comments – viewed 90,705 times – ( +10 / -2 ) – version 1.1
CJuiDatePicker displays a datepicker. CJuiDatePicker encapsulates the JUI datepicker plugin.

CGridView Date Range Without Cookies or Session (External Filtering)

Updated about a year ago by ezekielnoobHow-tos6 comments – viewed 12,558 times – ( +5 ) – version 1.1
Here's a tutorial on how to create a CGridView with external date filters the trick is to create hidden columns within the CGridView Filters something like in the example below:

Save and Display Date/Time Fields in different formats in Yii2

Updated 2 years ago by Kartik VHow-tos12 comments – viewed 89,036 times – ( +39 ) – version 2.0
You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.

Model validation for field ranges using yii2-field-range extension

Updated 2 years ago by Kartik VTips0 comments – viewed 12,292 times – ( +39 ) – version 2.0
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.

Using the yii2-datecontrol extension along with yii2-detail-view widget

Updated 2 years ago by Kartik VHow-tos0 comments – viewed 8,500 times – ( +35 ) – version 2.0
The yii2-datecontrol extension allows you to control separate date formats for display and saving for form inputs.

Adding a date range search for CGridView the easy way

Updated 3 years ago by mikewalenTips6 comments – viewed 29,224 times – ( +12 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.

Using International Dates

Updated 4 years ago by nkdHow-tos4 comments – viewed 37,348 times – ( +18 ) – version 1.1
I needed British (dd/mm/yyyy) formatted dates throughout my application but found it very difficult to find examples of how to do this - until I found this excellent forum post http://www.yiiframework.com/forum/index.php?/topic/3649-dealing-with-i18n-date-formats/

Local time zones and locales

Updated 5 years ago by Russell EnglandHow-tos9 comments – viewed 68,295 times – ( +14 / -2 ) – version 1.1
Following on from international dates, I also wanted times in the local timezone and format. This was a little more tricky but I think I've got a solution. This is only really appropriate if you have an international app.