Skip to content
Merged
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ language: php
php:
- 5.3
- 5.4
- 5.5
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would still run builds with older still supported PHP versions to be sure to not introduce any regressions.


env:
- SYMFONY_VERSION=v2.3.3
- SYMFONY_VERSION=v2.8
- SYMFONY_VERSION=origin/master

before_script:
Expand Down
4 changes: 2 additions & 2 deletions Form/Type/DatetimeType.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DatetimeType extends AbstractType
*
* @param array $options
*/
public function __construct(array $options)
public function __construct(array $options = array())
{
$this->options = $options;

Expand Down Expand Up @@ -164,7 +164,7 @@ public function getParent()

public function getName()
{
return 'collot_datetime';
return $this->getBlockPrefix();
}

public function getBlockPrefix()
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,16 @@ $ php app/console assets:install web/
``` php
<?php
// ...
use SC\DatetimepickerBundle\Form\Type\DatetimeType;

public function buildForm(FormBuilder $builder, array $options)
{
$builder
// defaut options
->add('createdAt', 'collot_datetime')
->add('createdAt', DatetimeType::class)

// full options
->add('updatedAt', 'collot_datetime', array( 'pickerOptions' =>
->add('updatedAt', DatetimeType::class, array( 'pickerOptions' =>
array('format' => 'mm/dd/yyyy',
'weekStart' => 0,
'startDate' => date('m/d/Y'), //example
Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
}
],
"require": {
"php": ">=5.3",
"symfony/framework-bundle": "2.*",
"symfony/symfony": "2.*"
"php": ">=5.3.9",
"symfony/framework-bundle": "~2.8 || ~3.0",
"symfony/symfony": "~2.8 || ~3.0"
},
"autoload": {
"psr-0": {
Expand Down