X-Git-Url: https://git-public.kairo.at/?a=blobdiff_plain;ds=sidebyside;f=classes%2Fdocument.php-class;fp=classes%2Fdocument.php-class;h=c48415fd22e66aa26f09143a33c6e351d1639891;hb=177ee3d6d61f67cebe1213f559abadd8f7b94380;hp=c2f0fcfe0d9107d7baf897774dd79bda2d2f44f7;hpb=b79cf81179b594491075187803443f7f343844d4;p=php-utility-classes.git
diff --git a/classes/document.php-class b/classes/document.php-class
index c2f0fcf..c48415f 100755
--- a/classes/document.php-class
+++ b/classes/document.php-class
@@ -89,6 +89,10 @@ class ExtendedDocument extends DOMDocument {
// appends an ExtendedDocument::createElementInputTime() as a child of this document (see there for params)
// returns the new child
//
+ // public function appendInputDateTime($name, [$id], [$min], [$max], [$value])
+ // appends an ExtendedDocument::createElementInputDateTime() as a child of this document (see there for params)
+ // returns the new child
+ //
// public function appendInputColor($name, [$id], [$value])
// appends an ExtendedDocument::createElementInputColor() as a child of this document (see there for params)
// returns the new child
@@ -226,6 +230,10 @@ class ExtendedDocument extends DOMDocument {
// returns an ExtendedElement that is an HTML of type 'time' with the given name,
// and optionally id, min, max, and value
//
+ // public function createElementInputDateTime($name, [$id], [$min], [$max], [$value])
+ // returns an ExtendedElement that is an HTML of type 'datetime-local' with the given name,
+ // and optionally id, min, max, and value
+ //
// public function createElementInputColor($name, [$id], [$value])
// returns an ExtendedElement that is an HTML of type 'color' with the given name,
// and optionally id and value
@@ -383,6 +391,9 @@ class ExtendedDocument extends DOMDocument {
public function appendInputTime($name, $id = null, $min = null, $max = null, $value = null) {
return $this->appendChild($this->createElementInputTime($name, $id, $min, $max, $value));
}
+ public function appendInputDateTime($name, $id = null, $min = null, $max = null, $value = null) {
+ return $this->appendChild($this->createElementInputDateTime($name, $id, $min, $max, $value));
+ }
public function appendInputColor($name, $id = null, $value = null) {
return $this->appendChild($this->createElementInputColor($name, $id, $value));
}
@@ -613,6 +624,17 @@ class ExtendedDocument extends DOMDocument {
return $timefield;
}
+ public function createElementInputDateTime($name, $id = null, $min = null, $max = null, $value = null) {
+ $dtfield = $this->createElement('input');
+ $dtfield->setAttribute('type', 'datetime-local');
+ if (!is_null($id)) { $dtfield->setAttribute('id', $id); }
+ $dtfield->setAttribute('name', $name);
+ if (!is_null($min)) { $dtfield->setAttribute('min', $min); }
+ if (!is_null($max)) { $dtfield->setAttribute('max', $max); }
+ if (!is_null($value)) { $dtfield->setAttribute('value', str_replace(' ', 'T', $value, 1)); }
+ return $dtfield;
+ }
+
public function createElementInputColor($name, $id = null, $value = null) {
$colfield = $this->createElement('input');
$colfield->setAttribute('type', 'color');
@@ -815,6 +837,10 @@ class ExtendedElement extends DOMElement {
// appends an ExtendedDocument::createElementInputTime() as a child of this element (see there for params)
// returns the new child
//
+ // public function appendInputDateTime($name, [$id], [$min], [$max], [$value])
+ // appends an ExtendedDocument::createElementInputDateTime() as a child of this element (see there for params)
+ // returns the new child
+ //
// public function appendInputColor($name, [$id], [$value])
// appends an ExtendedDocument::createElementInputColor() as a child of this element (see there for params)
//
@@ -963,6 +989,9 @@ class ExtendedElement extends DOMElement {
public function appendInputTime($name, $id = null, $min = null, $max = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputTime($name, $id, $min, $max, $value));
}
+ public function appendInputDateTime($name, $id = null, $min = null, $max = null, $value = null) {
+ return $this->appendChild($this->ownerDocument->createElementInputDateTime($name, $id, $min, $max, $value));
+ }
public function appendInputColor($name, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputColor($name, $id, $value));
}
@@ -1114,6 +1143,10 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
// appends an ExtendedDocument::createElementInputTime() as a child of this fragment (see there for params)
// returns the new child
//
+ // public function appendInputDateTime($name, [$id], [$min], [$max], [$value])
+ // appends an ExtendedDocument::createElementInputDateTime() as a child of this fragment (see there for params)
+ // returns the new child
+ //
// public function appendInputColor($name, [$id], [$value])
// appends an ExtendedDocument::createElementInputColor() as a child of this fragment (see there for params)
//
@@ -1252,6 +1285,9 @@ class ExtendedDocumentFragment extends DOMDocumentFragment {
public function appendInputTime($name, $id = null, $min = null, $max = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputTime($name, $id, $min, $max, $value));
}
+ public function appendInputDateTime($name, $id = null, $min = null, $max = null, $value = null) {
+ return $this->appendChild($this->ownerDocument->createElementInputDateTime($name, $id, $min, $max, $value));
+ }
public function appendInputColor($name, $id = null, $value = null) {
return $this->appendChild($this->ownerDocument->createElementInputColor($name, $id, $value));
}