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

Already on GitHub? Sign in to your account

Fixed a bug in the dateTime function of the form helper. #57

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
2 participants
Contributor

romaimperator commented Apr 20, 2011

I fixed a bug in the dateTime function that prevented the proper hour from being selected because the check for past noon required seconds to be set and they weren't. The view needed hour, minute, and meridian boxes and the time to be shown was 18:15. Debugging the value of $check showed that it was 1815 which is not greater than 115959 which prevented the 12 hours from being subtracted which then prevented the value of 6 from being selected by default in the HTML select box. This fix instead checks to see if the hours is greater than 12 and if so subtracts 12 and sets the meridian to PM.

fixed a bug in the dateTime function that prevented the proper hour f…
…rom being selected because the check for past noon required seconds to be set and they weren't
Owner

markstory commented Apr 20, 2011

How would one reproduce this issue? Without a way to reproduce its hard to write a test case.

Contributor

romaimperator commented Apr 21, 2011

With this code for a view, model, and controller (https://gist.github.com/933435) and using a fresh download of CakePHP 1.3.8, I was able to get it to leave the default of 1 selected rather than the correct hour of 6.

markstory added a commit that referenced this pull request May 10, 2011

Owner

markstory commented May 10, 2011

Thanks for the patch, its been merged in. :)

@markstory markstory closed this May 10, 2011

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment