Skip to content
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

bug in html5 time method #9

Closed
dereuromark opened this issue Jul 16, 2011 · 9 comments
Closed

bug in html5 time method #9

dereuromark opened this issue Jul 16, 2011 · 9 comments

Comments

@dereuromark
Copy link

html5 time method always fails in my projects (tests and app itself)
and I cannot figure out why

<time datetime="Y-M-dTH:i+00:00">1978-12-29 20:20:22</time>

or

<time datetime="Y-M-dTH:i+00:00" format="Y-m-d">Y-m-d</time>

instead of what it should be.

maybe sth changed in the core time helper? seems like its the formatting. i am running unter 1.3.10 head

@ProLoser
Copy link
Owner

hah, silly me, I put the TimeHelper::format() arguments in the wrong order.

@dereuromark
Copy link
Author

are the rests running through now? because I still have some issues

     <time datetime="1978-12-29T20:20:22+01:00">1978-12-29 20:20:22</time>

but should be:

Array
(
    [time] => Array
        (
            [class] => birthday
            [datetime] => 20:20:22
        )

    [0] => Fri 29th of Dec '78 08:20pm
    [1] => /time
)

@ProLoser ProLoser reopened this Jul 17, 2011
@ProLoser
Copy link
Owner

I'm not good with tests so I haven't updated them. You're using my fork, right?

I guess I forgot to allow custom parameters to be passed? Can you show me the line of code you're using?

@dereuromark
Copy link
Author

yes, i did.

welll, all time tests are failing. they all do not get formatted into human readable format :)

@ProLoser
Copy link
Owner

Can you paste the line of code you were using
On Jul 16, 2011 6:59 PM, "dereuromark" <
reply@reply.github.com>
wrote:

are the rests running through now? because I still have some issues

1978-12-29 20:20:22

but should be:

Array
(
[time] => Array
(
[class] => birthday
[datetime] => 20:20:22
)

[0] => Fri 29th of Dec '78 08:20pm
[1] => /time
)

Reply to this email directly or view it on GitHub:
#9 (comment)

@ProLoser
Copy link
Owner

echo $this->HtmlPlus->time($post['Post']['created'], array('format' => 'Y-M-D'))

Appears to work for me. I need to see how you're attempting to use the method so that I can perhaps improve it's syntax (or at least the documentation).

It's currently designed to use the TimeHelper to format a string.

@dereuromark
Copy link
Author

i didnt change your files
i simply use the plugin and execute the test case

its windows on php5.3. maybe there is something different with the formatting of the date function?
6 failed tests in the htmlplus helper test case

and i did check out the current head again today and how there are 10 failing tests.
really strange..

is it possible that you mixed up the methods? maybe we should use strftime() instead of format()?

@ProLoser
Copy link
Owner

I haven't been updating the tests. I'm not really profficient at tests. I
need to go back and learn how to do them. Heh, sorry.

On Sun, Jul 17, 2011 at 3:45 AM, dereuromark <
reply@reply.github.com>wrote:

i didnt change your files
i simply use the plugin and execute the test case

its windows on php5.3. maybe there is something different with the
formatting of the date function?
6 failed tests in the htmlplus helper test case

and i did check out the current head again today and how there are 10
failing tests.
really strange..

is it possible that you mixed up the methods? maybe we should use
strftime() instead of format()?

Reply to this email directly or view it on GitHub:
#9 (comment)

@dereuromark
Copy link
Author

i also tried i18nformat() with your test cases. not working either.
what a bugger

by the way: you might be interested to hear that i opened a ticket regarding the order of the params:
http://cakephp.lighthouseapp.com/projects/42648-cakephp/tickets/1834-inconsistent-time-helper-params

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants