mirror of
https://github.com/e107inc/e107.git
synced 2025-07-16 04:26:20 +02:00
Added inline datepicker option.
This commit is contained in:
@ -27,7 +27,7 @@ $(document).ready(function()
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Inline versions
|
// Inline versions
|
||||||
$("span.e-date").each(function() {
|
$("div.e-date").each(function() {
|
||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
var newid = id.replace("inline-", "");
|
var newid = id.replace("inline-", "");
|
||||||
$(this).datepicker({
|
$(this).datepicker({
|
||||||
@ -41,17 +41,18 @@ $(document).ready(function()
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$("span.e-datetime").each(function() {
|
$("div.e-datetime").each(function() {
|
||||||
var id = $(this).attr("id");
|
var id = $(this).attr("id");
|
||||||
var newid = id.replace("inline-", "");
|
var newid = id.replace("inline-", "");
|
||||||
$(this).datetimepicker({
|
$(this).datetimepicker({
|
||||||
dateFormat: $(this).attr("data-date-format"),
|
dateFormat: $(this).attr("data-date-format"),
|
||||||
ampm: $(this).attr("data-date-ampm"),
|
ampm: $(this).attr("data-date-ampm"),
|
||||||
defaultDate: $("#"+newid).val(),
|
showButtonPanel: false,
|
||||||
onSelect: function(dateText, inst) {
|
onSelect: function(dateText, inst) {
|
||||||
$("#"+newid).val(dateText);
|
$("#"+newid).val(dateText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
$(this).datetimepicker('setDate', $("#"+newid).val());
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
@ -324,6 +325,12 @@ $(document).ready(function()
|
|||||||
|
|
||||||
var id = $(this).attr("href");
|
var id = $(this).attr("href");
|
||||||
var src = $(this).attr("data-src");
|
var src = $(this).attr("data-src");
|
||||||
|
if(src == null) // old way - href='myscript.php#id-to-target
|
||||||
|
{
|
||||||
|
var tmp = src.split('#');
|
||||||
|
id = tmp[1];
|
||||||
|
src = tmp[0];
|
||||||
|
}
|
||||||
var effect = $(this).attr("data-effect");
|
var effect = $(this).attr("data-effect");
|
||||||
|
|
||||||
$(id).load(src + " ",function() {
|
$(id).load(src + " ",function() {
|
||||||
|
@ -131,7 +131,7 @@ class convert
|
|||||||
// also in php compat handler for plugins that might use it.
|
// also in php compat handler for plugins that might use it.
|
||||||
$tdata = $this->strptime($date_string, $mask);
|
$tdata = $this->strptime($date_string, $mask);
|
||||||
|
|
||||||
print_a($tdata);
|
// print_a($tdata);
|
||||||
|
|
||||||
if(empty($tdata))
|
if(empty($tdata))
|
||||||
{
|
{
|
||||||
|
@ -333,6 +333,8 @@ class e_form
|
|||||||
|
|
||||||
$type = ($options['type']) ? trim($options['type']) : "date";
|
$type = ($options['type']) ? trim($options['type']) : "date";
|
||||||
|
|
||||||
|
// echo "TYPE=".$type;
|
||||||
|
|
||||||
$ampm = (preg_match("/%l|%I|%p|%P/",$timeFormat)) ? 'true' : 'false';
|
$ampm = (preg_match("/%l|%I|%p|%P/",$timeFormat)) ? 'true' : 'false';
|
||||||
|
|
||||||
$convert = array(
|
$convert = array(
|
||||||
@ -392,8 +394,8 @@ class e_form
|
|||||||
|
|
||||||
if(vartrue($options['inline']))
|
if(vartrue($options['inline']))
|
||||||
{
|
{
|
||||||
return "<span class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' ></span>
|
return "<div class='{$class}' id='inline-{$id}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' ></div>
|
||||||
<input type='text' size='40' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' />
|
<input type='hidden' name='{$name}' id='{$id}' value='{$value}' data-date-format='{$dformat}' data-time-format='{$tformat}' data-date-ampm='{$ampm}' />
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -1919,7 +1921,7 @@ class e_form
|
|||||||
{
|
{
|
||||||
return $this->hidden($key, $value);
|
return $this->hidden($key, $value);
|
||||||
}
|
}
|
||||||
print_a($parms);
|
|
||||||
return $this->datepicker($key, $value, $parms);
|
return $this->datepicker($key, $value, $parms);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user