There has been some progress on this for the next version. As for the next release date, we are not quite certain at the moment... we are still actively working on it.
ya , my client is request for d/m/y for quite some time or at least something like "Jan 3 2010", since asia country here mostly using dd mm yyyy, current setting might be quite confuse for them.
Comments
Change the format strings in here to:
dd-mm-yyyy
Next, in MY_date_helper.php overwrite the existing function with this:
function english_date_to_db_format($date, $hour = 0, $min = 0, $sec = 0, $ampm = 'am') { $hour = (int) $hour; $min = (int) $min; $sec = (int) $sec; if ($hour > 12) $ampm = 'pm'; if ($ampm == 'pm' and $hour < 12) { $hour += 12; } else if ($ampm == 'am' and $hour == 12) { $hour = 0; } $date_arr = preg_split('#-|/#', $date); if (count($date_arr) != 3) return 'invalid'; # Convert them all to integers foreach($date_arr as $key => $val) { $date_arr[$key] = (int) $date_arr[$key]; # Convert to integer } $new_date = ''; if (preg_match("#([0-9]{1,2})/([0-9]{1,2})/([0-9]{4})#", $date)) { if ( ! checkdate($date_arr[0], $date_arr[1], $date_arr[2])) { return 'invalid'; # Null will cause it to be ignored in validation } $new_date = $date_arr[2].'-'.$date_arr[0].'-'.$date_arr[1].' '.$hour.':'.$min.':'.$sec; } else if (preg_match("#([0-9]{1,2})-([0-9]{1,2})-([0-9]{4})#", $date)) { if ( ! checkdate($date_arr[1], $date_arr[0], $date_arr[2])) { return 'invalid'; # Null will cause it to be ignored in validation } $new_date = $date_arr[2].'-'.$date_arr[1].'-'.$date_arr[0].' '.$hour.':'.$min.':'.$sec; } else { return 'invalid'; } $date = date("Y-m-d H:i:s", strtotime($new_date)); # normalize return $date; }
That code is attributed to the Daylight guys, not me.
That should be it if IIRC.
The format of dd-mm-yyyy has to be hyphens as strtotime() can't distinguish dd/mm/yyyy from mm/dd/yyyy.
I did miss one thing, the date_format in Form_builder needs to be d-m-y.
Pretty sure _thats_ it. There was some changes in my_model::clean but I'm sure those were reversed in favor of the above.