Project

General

Profile

Bug #18278 » time_bug_fix_7626_v2.diff

Administrator Admin, 2008-02-24 15:56

View differences:

t3lib/class.t3lib_tceforms.php (working copy)
$cOnClick = 'typo3form.fieldGet('.$paramsList.',1,\''.$checkSetValue.'\');'.implode('',$PA['fieldChangeFunc']);
$item.='<input type="checkbox"'.$this->insertDefStyle('check').' name="'.$PA['itemFormElName'].'_cb" onclick="'.htmlspecialchars($cOnClick).'" />';
}
if((in_array('date',$evalList) || in_array('datetime',$evalList)) && $PA['itemFormElValue']>0){
// Add server timezone offset to UTC to our stored date
$hoursOffset = date('O',$PA['itemFormElValue'])/100;
$PA['itemFormElValue'] += ($hoursOffset*60*60);
}
$PA['fieldChangeFunc'] = array_merge(array('typo3form.fieldGet'=>'typo3form.fieldGet('.$paramsList.');'), $PA['fieldChangeFunc']);
$mLgd = ($config['max']?$config['max']:256);
t3lib/jsfunc.evalfield.js (working copy)
} else {
year = this.getYear(today);
}
var month = (values.values[this.USmode?1:2])?this.parseInt(values.values[this.USmode?1:2]):today.getUTCMonth()+1;
var day = (values.values[this.USmode?2:1])?this.parseInt(values.values[this.USmode?2:1]):today.getUTCDate();
var month = (values.values[this.USmode?1:2])?this.parseInt(values.values[this.USmode?1:2]):today.getMonth()+1;
var day = (values.values[this.USmode?2:1])?this.parseInt(values.values[this.USmode?2:1]):today.getDate();
var theTime = new Date(parseInt(year), parseInt(month)-1, parseInt(day));
// Substract timezone offset from client
this.lastDate = this.getTimestamp(theTime);
theTime.setTime((this.lastDate - theTime.getTimezoneOffset()*60)*1000);
this.lastDate = this.getTimestamp(theTime);
}
this.lastDate+=add*24*60*60;
return this.lastDate;
......
var theTime = new Date(this.getYear(today), today.getUTCMonth(), today.getUTCDate(), hour, min, ((type=="timesec")?sec:0));
this.lastTime = this.getTimestamp(theTime);
theTime.setTime((this.lastTime - theTime.getTimezoneOffset()*60)*1000);
theTime.setTime((this.lastTime - (theTime.getTimezoneOffset() + top.serverTimezoneOffset)*60)*1000);
this.lastTime = this.getTime(theTime);
}
this.lastTime+=add*60;
......
if (!parseInt(value)) {return '';}
var theTime = new Date(parseInt(value) * 1000);
if (this.USmode) {
theString = (theTime.getUTCMonth()+1)+'-'+theTime.getUTCDate()+'-'+this.getYear(theTime);
theString = (theTime.getMonth()+1)+'-'+theTime.getDate()+'-'+this.getYear(theTime);
} else {
theString = theTime.getUTCDate()+'-'+(theTime.getUTCMonth()+1)+'-'+this.getYear(theTime);
theString = theTime.getDate()+'-'+(theTime.getMonth()+1)+'-'+this.getYear(theTime);
}
break;
case "datetime":
typo3/backend.php (working copy)
if($GLOBALS['BE_USER']->uc['noMenuMode'] === 'icons') {
$menuFrameName = 'topmenuFrame';
}
//calculate Servers Timezone
$d = date('O');
$minutes = substr($d,1,2)*60 + substr($d,3,2);
$serverTimezoneOffset = intval(substr($d,0,1) + $minutes);
$this->js .= '
// this is the timezone offset of the server
var serverTimezoneOffset = ' . $serverTimezoneOffset . ';
/**
* Function similar to PHPs rawurlencode();
*/
(2-2/3)