I am trying to add a datetime custom product attribute but it is showing date only I want to show time as well:
Here is my install script:
<?php
namespace CustomProductSchedulerSetup;
use MagentoEavSetupEavSetup;
use MagentoEavSetupEavSetupFactory;
use MagentoFrameworkSetupInstallDataInterface;
use MagentoFrameworkSetupModuleContextInterface;
use MagentoFrameworkSetupModuleDataSetupInterface;
class InstallData implements InstallDataInterface
{
private $eavSetupFactory;
public function __construct(EavSetupFactory $eavSetupFactory)
{
$this->eavSetupFactory = $eavSetupFactory;
}
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context)
{
$eavSetup = $this->eavSetupFactory->create(['setup' => $setup]);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'schedule_end',
[
'group' => 'Custom Product Scheduler',
'label' => 'Schedule End Time',
'type' => 'datetime',
'input' => 'date',
'class' => 'validate-date',
'backend' => 'CustomProductSchedulerModelEntityAttributeBackendDatetime',
'required' => false,
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_STORE,
'visible' => true,
'user_defined' => true,
'default' => '',
'searchable' => true,
'filterable' => true,
'filterable_in_search' => true,
'visible_in_advanced_search' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false
]
);
$eavSetup->addAttribute(
MagentoCatalogModelProduct::ENTITY,
'schedule_status',
[
'group' => 'Custom Product Scheduler',
'type' => 'int',
'backend' => '',
'frontend' => '',
'label' => 'Schedule End Status',
'input' => 'boolean',
'class' => '',
'source' => MagentoEavModelEntityAttributeSourceBoolean::class,
'global' => MagentoEavModelEntityAttributeScopedAttributeInterface::SCOPE_GLOBAL,
'visible' => false,
'required' => false,
'user_defined' => true,
'default' => '1',
'searchable' => true,
'filterable' => true,
'comparable' => false,
'visible_on_front' => true,
'used_in_product_listing' => true,
'unique' => false,
'apply_to' => 'simple'
]
);
}
}
Any help would be appreciated.