EditAssetForm: use datetime-local input type for date captured field
This commit is contained in:
@@ -42,7 +42,8 @@ class EditAsset extends HTMLController
|
||||
// Key info
|
||||
if (isset($_POST['title'], $_POST['slug'], $_POST['date_captured'], $_POST['priority']))
|
||||
{
|
||||
$date_captured = !empty($_POST['date_captured']) ? new DateTime($_POST['date_captured']) : null;
|
||||
$date_captured = !empty($_POST['date_captured']) ?
|
||||
new DateTime(str_replace('T', ' ', $_POST['date_captured'])) : null;
|
||||
$slug = strtr($_POST['slug'], [' ' => '-', '--' => '-', '&' => 'and', '=>' => '', "'" => "", ":"=> "", '\\' => '-']);
|
||||
$asset->setKeyData(htmlspecialchars($_POST['title']), $slug, $date_captured, intval($_POST['priority']));
|
||||
}
|
||||
@@ -50,9 +51,11 @@ class EditAsset extends HTMLController
|
||||
// Handle tags
|
||||
$new_tags = [];
|
||||
if (isset($_POST['tag']) && is_array($_POST['tag']))
|
||||
{
|
||||
foreach ($_POST['tag'] as $id_tag => $bool)
|
||||
if (is_numeric($id_tag))
|
||||
$new_tags[] = $id_tag;
|
||||
}
|
||||
|
||||
$current_tags = array_keys($asset->getTags());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user