Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reworked all date handling and formatting throughout the system. form…
…at_date() handles output based on a setting and everything in a date picker field must be YYYY-MM-DD with no exceptions. Fixes news date weirdness.
- Loading branch information
Phil Sturgeon
committed
Jan 24, 2011
1 parent
269d216
commit f701f80
Showing
23 changed files
with
379 additions
and
351 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php defined('BASEPATH') OR exit('No direct script access allowed.'); | ||
|
||
/** | ||
* CodeIgniter Date Helpers | ||
* | ||
* @package CodeIgniter | ||
* @subpackage Helpers | ||
* @category Helpers | ||
* @author Philip Sturgeon | ||
*/ | ||
|
||
// ------------------------------------------------------------------------ | ||
|
||
function format_date($unix) | ||
{ | ||
if ($unix == '' || ! is_numeric($unix)) | ||
{ | ||
$unix = strtotime($unix); | ||
} | ||
|
||
return date(get_instance()->settings->date_format, $unix); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php defined('BASEPATH') OR exit('No direct script access allowed'); | ||
|
||
class Migration_AddedDateFormat extends Migration { | ||
|
||
function up() | ||
{ | ||
$this->migrations->verbose AND print "Added setting - date_format."; | ||
|
||
//can you set default to null with dbforge? | ||
$this->db->insert('settings', array( | ||
'slug' => 'date_format', | ||
'title' => 'Date Format', | ||
'description' => 'How should dates be displayed accross the website and control panel? Using PHP date format.', | ||
'type' => 'text', | ||
'`default`' => 'Y-m-d', | ||
'`value`' => '', | ||
'`options`' => '', | ||
'module' => '', | ||
'is_required' => 1, | ||
'is_gui' => 1 | ||
)); | ||
} | ||
|
||
function down() | ||
{ | ||
$this->db->delete('settings', array('slug' => 'date_format')); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
f701f80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
error after intaller steps complete: http://marcoscoelho.com/public/screenshot/v1.0.3_error_after_intall.png
f701f80
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the heads up. It was installing clean then trying to run through migrations, which is not good! I have patched this for now and I will code it up to automatically install to the newest migration in the future.