mirror of
https://github.com/e107inc/e107.git
synced 2025-08-08 07:36:32 +02:00
Closes #330
This commit is contained in:
@@ -23,6 +23,8 @@ $sql = e107::getDb();
|
|||||||
|
|
||||||
$sql->db_Mark_Time('(Header Top)');
|
$sql->db_Mark_Time('(Header Top)');
|
||||||
|
|
||||||
|
e107::css('core', 'bootstrap-datetimepicker/css/datetimepicker.css', 'jquery');
|
||||||
|
e107::js('core', 'bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js', 'jquery', 2);
|
||||||
|
|
||||||
e107::js('core', 'bootstrap/js/bootstrap-tooltip.js','jquery');
|
e107::js('core', 'bootstrap/js/bootstrap-tooltip.js','jquery');
|
||||||
e107::css('core', 'bootstrap/css/tooltip.css','jquery');
|
e107::css('core', 'bootstrap/css/tooltip.css','jquery');
|
||||||
|
@@ -612,57 +612,40 @@ class e_form
|
|||||||
* @example $frm->datepicker('my_field',time(),'type=date');
|
* @example $frm->datepicker('my_field',time(),'type=date');
|
||||||
* @example $frm->datepicker('my_field',time(),'type=datetime&inline=1');
|
* @example $frm->datepicker('my_field',time(),'type=datetime&inline=1');
|
||||||
* @example $frm->datepicker('my_field',time(),'type=date&format=yyyy-mm-dd');
|
* @example $frm->datepicker('my_field',time(),'type=date&format=yyyy-mm-dd');
|
||||||
|
* @example $frm->datepicker('my_field',time(),'type=datetime&format=MM, dd, yyyy hh:ii');
|
||||||
*
|
*
|
||||||
* @url http://trentrichardson.com/examples/timepicker/
|
* @url http://trentrichardson.com/examples/timepicker/
|
||||||
*/
|
*/
|
||||||
function datepicker($name, $datestamp = false, $options = null)
|
function datepicker($name, $datestamp = false, $options = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
if(vartrue($options) && is_string($options))
|
if(vartrue($options) && is_string($options))
|
||||||
{
|
{
|
||||||
parse_str($options,$options);
|
parse_str($options,$options);
|
||||||
}
|
}
|
||||||
|
|
||||||
$type = varset($options['type']) ? trim($options['type']) : "date"; // 'datetime'
|
$type = varset($options['type']) ? trim($options['type']) : "date"; // OR 'datetime'
|
||||||
$dateFormat = varset($options['format']) ? trim($options['format']) :e107::getPref('inputdate', '%Y-%m-%d');
|
$dateFormat = varset($options['format']) ? trim($options['format']) :e107::getPref('inputdate', '%Y-%m-%d');
|
||||||
// $timeFormat = varset($options['timeformat']) ? trim($options['timeformat']) :e107::getPref('inputtime', '%H:%M:%S');
|
$ampm = (preg_match("/%l|%I|%p|%P/",$dateFormat)) ? 'true' : 'false';
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if($type == 'datetime' && !varset($options['format']))
|
if($type == 'datetime' && !varset($options['format']))
|
||||||
{
|
{
|
||||||
$dateFormat .= " ".e107::getPref('inputtime', '%H:%M:%S');
|
$dateFormat .= " ".e107::getPref('inputtime', '%H:%M:%S');
|
||||||
}
|
}
|
||||||
|
|
||||||
// echo "TYPE=".$type;
|
|
||||||
|
|
||||||
$ampm = (preg_match("/%l|%I|%p|%P/",$dateFormat)) ? 'true' : 'false';
|
|
||||||
|
|
||||||
$dformat = e107::getDate()->toMask($dateFormat);
|
$dformat = e107::getDate()->toMask($dateFormat);
|
||||||
// $tformat = e107::getDate()->toMask($timeFormat);
|
|
||||||
|
|
||||||
$id = $this->name2id($name);
|
$id = $this->name2id($name);
|
||||||
|
|
||||||
$classes = array(
|
$classes = array('date' => 'e-date', 'datetime' => 'e-datetime');
|
||||||
'date' => 'e-date',
|
|
||||||
// 'time' => 'e-time',
|
|
||||||
'datetime' => 'e-datetime'
|
|
||||||
);
|
|
||||||
|
|
||||||
$def = array(
|
|
||||||
'date' => $dateFormat,
|
|
||||||
// 'time' => $timeFormat,
|
|
||||||
'datetime' => $dateFormat // ." ".$timeFormat
|
|
||||||
);
|
|
||||||
|
|
||||||
$defdisp = (isset($def[$type])) ? $def[$type] : $def['date'];
|
|
||||||
|
|
||||||
if ($datestamp)
|
if ($datestamp)
|
||||||
{
|
{
|
||||||
$value = is_numeric($datestamp) ? e107::getDate()->convert_date($datestamp, $defdisp) : $datestamp; //date("d/m/Y H:i:s", $datestamp);
|
$value = is_numeric($datestamp) ? e107::getDate()->convert_date($datestamp, $dateFormat) : $datestamp; //date("d/m/Y H:i:s", $datestamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
$text = "";
|
$text = "";
|
||||||
// $text .= 'dformat='.$dformat.' defdisp='.$defdisp;
|
// $text .= 'dformat='.$dformat.' defdisp='.$dateFormat;
|
||||||
|
|
||||||
$class = (isset($classes[$type])) ? $classes[$type] : "tbox e-date";
|
$class = (isset($classes[$type])) ? $classes[$type] : "tbox e-date";
|
||||||
$size = vartrue($options['size']) ? intval($options['size']) : 40;
|
$size = vartrue($options['size']) ? intval($options['size']) : 40;
|
||||||
@@ -677,24 +660,11 @@ class e_form
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// http://tarruda.github.com/bootstrap-datetimepicker/
|
|
||||||
//XXX Problem -doesn't support non-numerical date formats. eg. 2 February, 2013
|
|
||||||
/*
|
|
||||||
$text .= "
|
|
||||||
<div class='{$class} input-append date'>
|
|
||||||
<input data-format='{$dformat}' type='text' id='{$id}' value='{$value}' />
|
|
||||||
<span class='add-on'>
|
|
||||||
<i data-time-icon='icon-time' data-date-icon='icon-calendar'></i>
|
|
||||||
</span>
|
|
||||||
</div>";
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
$text .= "<input class='{$class} input-xlarge' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' {$required} />";
|
$text .= "<input class='{$class} input-xlarge' type='text' size='{$size}' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-date-ampm='{$ampm}' data-date-firstday='{$firstDay}' {$required} />";
|
||||||
}
|
}
|
||||||
|
|
||||||
// $text .= "ValueFormat: ".$defdisp." Value: ".$value;
|
// $text .= "ValueFormat: ".$dateFormat." Value: ".$value;
|
||||||
// $text .= " ({$dformat}) type:".$defdisp." ".$value;
|
// $text .= " ({$dformat}) type:".$dateFormat." ".$value;
|
||||||
|
|
||||||
return $text;
|
return $text;
|
||||||
|
|
||||||
|
@@ -829,6 +829,12 @@ class e107_user_extended
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EUF_DATE : //date
|
case EUF_DATE : //date
|
||||||
|
|
||||||
|
if($curval == '0000-00-00') // Quick datepicker fix.
|
||||||
|
{
|
||||||
|
$curval = '';
|
||||||
|
}
|
||||||
|
|
||||||
return e107::getForm()->datepicker($fname,$curval,'format=yyyy-mm-dd');
|
return e107::getForm()->datepicker($fname,$curval,'format=yyyy-mm-dd');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@@ -31,11 +31,19 @@ min-height:50px;
|
|||||||
|
|
||||||
tr.highlight-odd { background-color: #212121; }
|
tr.highlight-odd { background-color: #212121; }
|
||||||
tr.highlight-even { background-color: #212121; }
|
tr.highlight-even { background-color: #212121; }
|
||||||
|
|
||||||
.datetimepicker table tr td.day:hover {
|
.datetimepicker table tr td.day:hover {
|
||||||
|
|
||||||
color: black;
|
color: black;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.datetimepicker table tr td span:hover {
|
||||||
|
color: black;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
.bootstrap-select.btn-group .dropdown-menu .optgroup-div {
|
.bootstrap-select.btn-group .dropdown-menu .optgroup-div {
|
||||||
color: #363636;
|
color: #363636;
|
||||||
}
|
}
|
||||||
|
@@ -127,6 +127,12 @@ td.options { }
|
|||||||
|
|
||||||
legend { display:none }
|
legend { display:none }
|
||||||
|
|
||||||
|
/* Datepicker */
|
||||||
|
fieldset.hour legend {
|
||||||
|
display: inline-block
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
.bootstrap-select.btn-group, .bootstrap-select.btn-group[class*="span"] {
|
.bootstrap-select.btn-group, .bootstrap-select.btn-group[class*="span"] {
|
||||||
|
|
||||||
margin-bottom: 0px;
|
margin-bottom: 0px;
|
||||||
|
@@ -70,8 +70,9 @@ function addtext_us(sc)
|
|||||||
document.getElementById('dataform').image.value = sc;
|
document.getElementById('dataform').image.value = sc;
|
||||||
}
|
}
|
||||||
");
|
");
|
||||||
e107::css('core', 'bootstrap-datetimepicker/css/datetimepicker.css', 'jquery');
|
|
||||||
e107::js('core', 'bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js', 'jquery', 2);
|
|
||||||
|
|
||||||
|
|
||||||
$photo_to_delete = '';
|
$photo_to_delete = '';
|
||||||
$avatar_to_delete = '';
|
$avatar_to_delete = '';
|
||||||
|
Reference in New Issue
Block a user