Skip to content

[Form] Stop automatic left '0' str_padding on the 'days' field on a date choice widget. #3490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

scp
Copy link

@scp scp commented Mar 2, 2012

Can't see of any other way of disabling this otherwise?

(Doesn't respect format=>'MMMM-d-y' like date 'single_text' widget, although it probably should...?)

…ice widget.

Can't see of any other way of disabling this otherwise?

(Doesn't respect format=>'MMMM-d-y' like date single_text widget, although it probably should...)
@fabpot
Copy link
Member

fabpot commented Mar 2, 2012

ping @bschussek

@stealth35
Copy link
Contributor

It's dd for the padded 0 date
http://userguide.icu-project.org/formatparse/datetime

@@ -83,7 +83,7 @@ public function buildForm(FormBuilder $builder, array $options)
$months[$month] = str_pad($month, 2, '0', STR_PAD_LEFT);
}
foreach ($options['days'] as $day) {
$days[$day] = str_pad($day, 2, '0', STR_PAD_LEFT);
$days[$day] = str_pad($day, 0, '0', STR_PAD_LEFT);
Copy link
Contributor

Choose a reason for hiding this comment

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

just drop the loop

@stof
Copy link
Member

stof commented Apr 3, 2012

@bschussek ping

@ruimarinho
Copy link

I have worked on a PR that should fix this issue, along with other DateType improvements. I'll submit it as soon as the master branch tests pass again.

@webmozart
Copy link
Contributor

What does this PR fix? Why do you consider the current behaviour buggy? Can you please add a testcase?

@fabpot
Copy link
Member

fabpot commented Jul 10, 2012

Closing this PR in favor of #3490

@fabpot fabpot closed this Jul 10, 2012
fabpot added a commit that referenced this pull request Jul 10, 2012
Commits
-------

5b057f8 [Form] Fixed DateType to use "format" for creating the year and day choices

Discussion
----------

[Form] Fixed DateType to use "format" for creating the year and day choices

Bug fix: yes
Feature addition: no
Backwards compatibility break: no
Symfony2 tests pass: yes
Fixes the following tickets: #3490
Todo: -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy