BakingPlate icon indicating copy to clipboard operation
BakingPlate copied to clipboard

bug in html5 time method

Open dereuromark opened this issue 14 years ago • 9 comments

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

dereuromark avatar Jul 16 '11 22:07 dereuromark

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

ProLoser avatar Jul 16 '11 23:07 ProLoser

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
)

dereuromark avatar Jul 17 '11 01:07 dereuromark

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?

ProLoser avatar Jul 17 '11 02:07 ProLoser

yes, i did.

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

dereuromark avatar Jul 17 '11 02:07 dereuromark

Can you paste the line of code you were using On Jul 16, 2011 6:59 PM, "dereuromark" < [email protected]> wrote:

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

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: https://github.com/ProLoser/BakingPlate/issues/9#issuecomment-1588770

ProLoser avatar Jul 17 '11 02:07 ProLoser

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.

ProLoser avatar Jul 17 '11 08:07 ProLoser

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()?

dereuromark avatar Jul 17 '11 10:07 dereuromark

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 < [email protected]>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: https://github.com/ProLoser/BakingPlate/issues/9#issuecomment-1589730

ProLoser avatar Jul 17 '11 10:07 ProLoser

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

dereuromark avatar Jul 17 '11 11:07 dereuromark