ProfessionalWiki / EDTF

PHP library to parse, represent and work with dates that follow the Extended Date/Time Format specification.
https://wikibase.consulting/wikibase-edtf
GNU General Public License v2.0
10 stars 7 forks source link

Fix handling of spaces in sets #59

Closed JeroenDeDauw closed 3 years ago

JeroenDeDauw commented 3 years ago

{ ..1983} is currently incorrectly interpreted as {0..1983}

{ ..1983} should be interpreted as {..1983}

chaudbak commented 3 years ago

Could you please specify which API method you use and observe invalid outcome? What is meant by 'interpreted as {0..1983}' And one more thing: $parser->parse({ ..1983}) doesn't accept this value at all and throws Invalid edtf format exception (because of spaces). Is it acceptable behaviour?

JeroenDeDauw commented 3 years ago

image

And one more thing: $parser->parse({ ..1983}) doesn't accept this value at all and throws Invalid edtf format exception (because of spaces). Is it acceptable behaviour?

Are you saying that is the current behavior? It does not seem to be, as per the screenshot. Ideally { ..1983} is understood to be {..1983}, though if an exception is thrown when the space is there, that is also fine.

chaudbak commented 3 years ago

Yes, exactly. That's the current behavior. I am not sure how the data presented on the screenshot is built, but I think it doesn't throws the exception, because it goes only through Humanizer which doesn't trigger Parser's parse method

Thanks for the explanation and the screenshot. Now it's clear that it's about the wrong humanization

JeroenDeDauw commented 3 years ago

@chaudbak so you can fix this now right?