-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
4.x native datetime #12934
4.x native datetime #12934
Conversation
We should make sure that all the "old" ways have an easy upgrade path to an existing method somewhere. best case: in core directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I second moving the existing widget into a plugin for people who want to upgrade but can't update their UI.
Along with existing DateTimeWidget the shim plugin will also need a FormHelper with retains all the options juggling that is currently done for datetime inputs. |
Yeah that is going to be awkward 😢 |
Codecov Report
@@ Coverage Diff @@
## 4.x #12934 +/- ##
============================================
+ Coverage 93.14% 93.26% +0.11%
- Complexity 13210 13417 +207
============================================
Files 470 471 +1
Lines 32804 33140 +336
============================================
+ Hits 30556 30908 +352
+ Misses 2248 2232 -16
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## 4.x #12934 +/- ##
============================================
- Coverage 93.15% 93.09% -0.07%
+ Complexity 13202 13130 -72
============================================
Files 468 469 +1
Lines 32801 32625 -176
============================================
- Hits 30556 30371 -185
- Misses 2245 2254 +9
Continue to review full report at Codecov.
|
135800e
to
f9c1faf
Compare
This is ready for review. |
@@ -50,6 +50,7 @@ class DateTimeType extends BaseType | |||
*/ | |||
protected $_format = [ | |||
'Y-m-d H:i:s', | |||
'Y-m-d\TH:i:s', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we backport this to 3.x?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably, it would be useful to those already using datetime-local
input.
Will you open a 4.x branch on Shim plugin to proof the upgrade possibilities for the former inputs? |
Yeah I'll make a PR to your Shim plugin. The more taxing job is updating the docs :) |
All right, we have a branch now: https://github.com/dereuromark/cakephp-shim/tree/4.x#new-shims |
Ancillary work of PR to Shim plugin and docs PR is done. This should be good to merge now. |
As discussed in #12820, this PR updates
FormHelper
to generate native HTML inputs for all available datetime types. I have modifiedDateTimeWidget
accordingly and added newYearWidget
to generate selectbox for years.Still have to do lot of cleanup.
What should be done for the individual
FormHelper()
methods for generating single selects likeday()
,hour()
,minute()
,seconds()
,meridian()
? My vote is to just drop them. They can still be generated usingselect()
with appropriate options list if some needs them.