Closed paulrwest closed 7 years ago
DateToolbox
class was created to convert jQuery's datepicker formats to PHP and vice versa, which allows more rich formatting, beyond to what Cake's Chronos may offer.
I'll take a look
please confirm if this patch solves the problem.
regards!
Hi Chris, echo $field->view_mode_settings['format'];//always like 'yy-mm-dd' When I setting the field date with format like "mm-dd-yy" but format of the field date always is 'yy-mm-dd'. Please fix.
Thank you!
Hi Chris, I'm sorry. It seems fixed on #b762a1a revision Thank you!
Thank you Chris for fixing this, so sorry I never got back to you, I got pulled off the CMS project but I'm back on it now and have updated and it seems to be working for me too.
I have found several issues with the Date Field type.
Issue 1) Setting any kind of format breaks the add/edit form within admin with the following error:
even though the date format is correct. removing all formatting is the only way to get the form to save.
Issue 2) DateToolbox::createFromFormat() always returns false.
\vendor\quickapps-plugins\field\src\Template\Element\DateField\display.ctp (line 18)
\vendor\quickapps-plugins\field\src\Utility\DateToolbox.php (line 74)
debug([$format, $date]);
all the above results in:
I would recommend switching to using Cakes built in Time/Chronos class for date fields and drop using 'DateToolbox' and maybe give the user a few format choices that Chronos supports "nice", "date", "dateTime" etc.