You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
That expects times in the format of: HH.mm - for example 03.20. Separator etc. adheres do Danish locale as described in ICU docs.
What happened
When using this shortened version, i.e. without seconds (03.20), then the marshal() method in class Cake\Database\Type\DateTimeType returns a string instead of FrozenTime object, as one of the tests is raising an exception (and the whole block of code depends on it).
It's precisely this test that raises the exception:
Input 03.20.00 is recognized correctly, as it does not evaluate to true on the is_numeric test.
What you expected to happen
My expectation would be: when Cake is instructed to use a locale-aware parser, and I also say to it: expect the input of the form HH.mm (according to ICU constants) - then I want in return a correct time-object instance, that is then correctly serialized into the DB column of type time.
At this point 03.20 is saved into db as 00:00:03.
I have at this point reversed the order of tests, i.e. I put the test that uses $this->_useLocaleParser flag in the else if statement before the is_numeric() test - and then everything works. I cannot see how this could fail in a broader context - hence a bug report to trigger a discussion.
The text was updated successfully, but these errors were encountered:
Some locale based formats look like numeric values. If locale parsing is
enabled we need to enter that case instead of the numeric one. By
restricting the valid format of timestamps we can do that.
Refs #10873
This is a (multiple allowed):
bug
enhancement
feature-discussion (RFC)
CakePHP Version: 3.4.5
Platform and Target: NGINX, MariaDB, PHP 7.0.15
What you did
intl.default_locale
is set toda_DK
.In
bootstrap.php
I have the following:That expects times in the format of:
HH.mm
- for example03.20
. Separator etc. adheres do Danish locale as described in ICU docs.What happened
When using this shortened version, i.e. without seconds (
03.20
), then themarshal()
method in classCake\Database\Type\DateTimeType
returns a string instead ofFrozenTime
object, as one of the tests is raising an exception (and the whole block of code depends on it).It's precisely this test that raises the exception:
It happens to be executed before this test:
Input
03.20.00
is recognized correctly, as it does not evaluate totrue
on theis_numeric
test.What you expected to happen
My expectation would be: when Cake is instructed to use a locale-aware parser, and I also say to it: expect the input of the form
HH.mm
(according to ICU constants) - then I want in return a correct time-object instance, that is then correctly serialized into the DB column of typetime
.At this point
03.20
is saved into db as00:00:03
.I have at this point reversed the order of tests, i.e. I put the test that uses
$this->_useLocaleParser
flag in theelse if
statement before theis_numeric()
test - and then everything works. I cannot see how this could fail in a broader context - hence a bug report to trigger a discussion.The text was updated successfully, but these errors were encountered: