Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit122fb7b

Browse files
committed
minor#10962 Show example on using a DateTimeImmutable object (pavlakis)
This PR was submitted for the 4.2 branch but it was merged into the 3.4 branch instead (closes#10962).Discussion----------Show example on using a DateTimeImmutable objectAdd an example on using DateTimeImmutable through the `input` option.<!--If your pull request fixes a BUG, use the oldest maintained branch that containsthe bug (seehttps://symfony.com/roadmap for the list of maintained branches).If your pull request documents a NEW FEATURE, use the same Symfony branch wherethe feature was introduced (and `master` for features of unreleased versions).-->Commits-------3bccc62 Show example on using a DateTimeImmutable object
2 parents56e73bb +3bccc62 commit122fb7b

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎reference/forms/types/date.rst‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,14 @@ field as **three different choice fields**::
6565
If your underlying date is *not* a ``DateTime`` object (e.g. it's a unix timestamp),
6666
configure the `input`_ option.
6767

68+
When working with a ``DateTimeImmutable`` object, add this as an ``input`` option::
69+
70+
$builder->add('publishedAt', DateType::class, [
71+
'widget' => 'choice',
72+
'input' => 'datetime_immutable'
73+
]);
74+
75+
6876
Rendering a single HTML5 Textbox
6977
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7078

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp