Skip to content

Commit

Permalink
Merge pull request #24 from bolt/feature/date-types
Browse files Browse the repository at this point in the history
Add Date, DateTime and DateInterval types
  • Loading branch information
bobdenotter authored Nov 13, 2020
2 parents 417bbcf + 7212461 commit 7203dae
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Factory/FieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\Extension\Core\Type\DateType;
use Symfony\Component\Form\Extension\Core\Type\DateTimeType;
use Symfony\Component\Form\Extension\Core\Type\DateIntervalType;

class FieldType
{
Expand All @@ -35,6 +38,15 @@ public static function get($field): string
case 'checkbox':
$type = CheckboxType::class;
break;
case 'date':
$type = DateType::class;
break;
case 'dateinterval':
$type = DateIntervalType::class;
break;
case 'datetime':
$type = DateTimeType::class;
break;
case 'text':
default:
$type = TextType::class;
Expand Down

0 comments on commit 7203dae

Please sign in to comment.