Skip to content

Commit

Permalink
Fixed issue #6433: Wrong date/time is showing in survey summary
Browse files Browse the repository at this point in the history
Dev This should also fix most other date conversion related issues
  • Loading branch information
c-schmitz committed Aug 7, 2012
1 parent 0e8dfd8 commit 805441e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion application/controllers/admin/surveyadmin.php
Expand Up @@ -1491,7 +1491,7 @@ function insert($iSurveyID=null)
{
Yii::import('application.libraries.Date_Time_Converter');
$converter = new Date_Time_Converter($sStartDate, $aDateFormatData['phpdate'] . ' H:i:s');
$sExpiryDate = $converter->convert("Y-m-d H:i:s");
$sStartDate = $converter->convert("Y-m-d H:i:s");
}

// If expiry date supplied convert it to the right format
Expand Down
8 changes: 4 additions & 4 deletions application/libraries/Date_Time_Converter.php
Expand Up @@ -58,15 +58,15 @@ class Date_Time_Converter
* without leading zeros (n,j,g,G) as long as they aren't bunched together.
* ie: ("1152008", "njY") wont work; ("1/15/2008", "n/j/2008") will work.
* Example: $obj = new Date_Time_Calc('12/30/2008 17:40:00', 'm/d/Y H:i:s'); */
public function __construct($data) {
public function __construct($sDate, $sFormat) {

require_once(APPPATH . '/helpers/adodb/adodb-time.inc_helper.php');
$this->_default_date_time_units(); //set date&time units to default values
$this->date_time = $data[0];
$this->date_time_mask = $data[1];
$this->date_time = $sDate;
$this->date_time_mask = $sFormat;

//convert date to timestamp
$this->date_time_stamp = $this->_date_to_timestamp($data[0], $data[1]);
$this->date_time_stamp = $this->_date_to_timestamp($sDate, $sFormat);
}


Expand Down

0 comments on commit 805441e

Please sign in to comment.