mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 20:30:39 +02:00
Date-input fix
This commit is contained in:
800
e107_files/jslib/jquery-ui-timepicker-addon.js
vendored
800
e107_files/jslib/jquery-ui-timepicker-addon.js
vendored
File diff suppressed because it is too large
Load Diff
@@ -43,10 +43,12 @@ class convert
|
||||
{
|
||||
case 'long':
|
||||
$mask = e107::getPref('longdate');
|
||||
// $datestamp += TIMEOFFSET;
|
||||
break;
|
||||
|
||||
case 'short':
|
||||
$mask = e107::getPref('shortdate');
|
||||
// $datestamp += TIMEOFFSET;
|
||||
break;
|
||||
|
||||
case 'input':
|
||||
@@ -71,10 +73,12 @@ class convert
|
||||
{
|
||||
$mask = e107::getPref('forumdate');
|
||||
}
|
||||
// $datestamp += TIMEOFFSET;
|
||||
break;
|
||||
}
|
||||
|
||||
$datestamp += TIMEOFFSET;
|
||||
//
|
||||
|
||||
return strftime($mask, $datestamp);
|
||||
}
|
||||
|
||||
@@ -131,6 +135,7 @@ class convert
|
||||
// also in php compat handler for plugins that might use it.
|
||||
$tdata = $this->strptime($date_string, $mask);
|
||||
|
||||
|
||||
// print_a($tdata);
|
||||
|
||||
if(empty($tdata))
|
||||
@@ -146,7 +151,12 @@ class convert
|
||||
($tdata['tm_year'] + 1900)
|
||||
);
|
||||
|
||||
|
||||
// echo "<br />UNIX=".$unxTimestamp - TIMEOFFSET;
|
||||
// echo "<br />".date("l, d M Y g:i A",$unxTimestamp);
|
||||
|
||||
// var_dump($tdata, $date_string, $this->convert_date($unxTimestamp, $mask), $unxTimestamp);
|
||||
|
||||
return $unxTimestamp;
|
||||
}
|
||||
|
||||
@@ -504,9 +514,9 @@ class convert
|
||||
|
||||
}
|
||||
|
||||
if($ampm && ($vals['tm_AMPM'] == 'PM' || $vals['tm_ampm'] == 'pm'))
|
||||
if($ampm && ($vals['tm_AMPM'] == 'AM' || $vals['tm_ampm'] == 'am') )
|
||||
{
|
||||
$vals['tm_hour'] = $vals['tm_hour'] + 12;
|
||||
$vals['tm_hour'] = intval($vals['tm_hour'] - 12);
|
||||
}
|
||||
|
||||
//$vals['tm_sec'] -= 1; always increasing tm_sec + 1 ??????
|
||||
|
@@ -440,10 +440,10 @@ class e_form
|
||||
parse_str($options,$options);
|
||||
}
|
||||
|
||||
$dateFormat = ($options['dateformat']) ? trim($options['dateformat']) :e107::getPref('inputdate', '%Y-%m-%d');
|
||||
$timeFormat = ($options['timeformat']) ? trim($options['timeformat']) :e107::getPref('inputtime', '%H:%M:%S');
|
||||
$dateFormat = varset($options['dateformat']) ? trim($options['dateformat']) :e107::getPref('inputdate', '%Y-%m-%d');
|
||||
$timeFormat = varset($options['timeformat']) ? trim($options['timeformat']) :e107::getPref('inputtime', '%H:%M:%S');
|
||||
|
||||
$type = ($options['type']) ? trim($options['type']) : "date"; // 'datetime'
|
||||
$type = varset($options['type']) ? trim($options['type']) : "date"; // 'datetime'
|
||||
|
||||
// echo "TYPE=".$type;
|
||||
|
||||
@@ -506,16 +506,16 @@ class e_form
|
||||
|
||||
if(vartrue($options['inline']))
|
||||
{
|
||||
return "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' ></div>
|
||||
$text .= "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' ></div>
|
||||
<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' />
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "<input class='{$class}' type='text' size='40' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' />";
|
||||
{
|
||||
$text .= "<input class='{$class}' type='text' size='40' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' />";
|
||||
}
|
||||
|
||||
|
||||
return $text;
|
||||
// Keep this info here:
|
||||
/*
|
||||
* $options allowed keys:
|
||||
|
Reference in New Issue
Block a user