Skip to content

Fix DateTime, when use it with D/l in format and textual day have dot at... - #237

Closed
gron1987 wants to merge 2 commits into
php:masterfrom
gron1987:fixDateTime
Closed

gron1987 wants to merge 2 commits into
php:masterfrom
gron1987:fixDateTime

Conversation

@gron1987

Copy link
Copy Markdown

Fix DateTime, when use it with D/l in format and textual day have dot at the end

For example :

$string = "Sun., Nov. 29, 2012 5:00PM";

$data = DateTime::createFromFormat( "D., M# j, Y g:iA", $string );

var_dump( $data );
var_dump( DateTime::getLastErrors() );

return

bool(false)
array(4) {
  'warning_count' =>
  int(0)
  'warnings' =>
  array(0) {
  }
  'error_count' =>
  int(2)
  'errors' =>
  array(2) {
    [0] =>
    string(32) "A textual day could not be found"
    [4] =>
    string(40) "The separation symbol could not be found"
  }
}

This fix add more stop characters ( from # )

@lstrojny

lstrojny commented Dec 2, 2012

Copy link
Copy Markdown
Contributor

Could you please add a test for it?

@lstrojny

lstrojny commented Jan 6, 2013

Copy link
Copy Markdown
Contributor

ping @gron1987

@gron1987

Copy link
Copy Markdown
Author

@lstrojny Sorry, crazy month. Will update tomorrow

@lstrojny

Copy link
Copy Markdown
Contributor

@gron1987 which "tomorrow" exactly? ;-)

@gron1987

Copy link
Copy Markdown
Author

@lstrojny Creating it now ) Just try to understand how it works :)

@gron1987

Copy link
Copy Markdown
Author

@lstrojny
Added yesterday

@lstrojny

Copy link
Copy Markdown
Contributor

@derick could you review?

@gron1987

gron1987 commented Mar 5, 2013

Copy link
Copy Markdown
Author

ping @lstrojny @derick

@lstrojny

lstrojny commented Mar 7, 2013

Copy link
Copy Markdown
Contributor

Sorry @gron1987, @derick ping again

@lstrojny

Copy link
Copy Markdown
Contributor

@derick ping again

@gron1987

gron1987 commented Apr 5, 2013

Copy link
Copy Markdown
Author

@lstrojny @derickr ping ? :)

@derickr

derickr commented Apr 5, 2013

Copy link
Copy Markdown
Member

I'm on holiday. If you could mail me a list of the issues in datetime then I'll look at asap

http://derickrethans.nl - http://xdebug.org
Like Xdebug? Consider a donation: http://xdebug.org/donate.php
twitter: @derickr and @xdebug

@smalyshev

Copy link
Copy Markdown
Contributor

This patch doesn't see to be correct. First, the file that needs to be patched is parse_date.re since parse_date.c is generated from it. Second, the test still fails for me.

@php-pulls

Copy link
Copy Markdown

Comment on behalf of stas at php.net:

I've fixed the patch and merged it

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

Successfully merging this pull request may close these issues.

5 participants