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