A simple Symfony bundle that adds timestamp form field type.
Add this to your composer.json
file:
"require": {
"bukashk0zzz/timestamptype-bundle": "^2.0",
}
Add the bundle to app/AppKernel.php
$bundles = array(
// ... other bundles
new Bukashk0zzz\TimestampTypeBundle\Bukashk0zzzTimestampTypeBundle(),
);
Not needed.
Inside a FormType:
class AccountProfileType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('nameFirst', TextType::class, ['label' => 'First Name'])
->add('nameLast', TextType::class, ['label' => 'Last Name'])
->add('startWorking', TimestampType::class, [
'label' => 'Start working from',
'required' => false,
])
;
}
}
See LICENSE