crudkit
crudkit copied to clipboard
Problem with date or datetime or timestamp in field type
Please fix this date field is not coming
Ok. I'll look into it... Thanks!
date is still not working and timestamp doesn't really work either. When attempting to add a new record the timestamp field shows up but the entry mechanism is broken.
I have the same problem too.
@MR-GamBit - is your field of type 'date' not 'datetime'?
It doesn't seem to handle date fields very well, but if you change the fields type from self::TYPE_DATE to self::TYPE_DATETIME it seems to be all cool again.
Not a particularly elegant fix, but it gets date fields working.
Hello any update about this issue? I use datetime as suggested above, but it seems the <datepicker .../> seems not rendered correctly. Just display tiny gray disabled box.
I did the following and the datepicker showed up, but date only...
- Download ui-bootstrap-tpls-0.13.0.min.js and put under static/crudkit/js/
- Add the line below to requires_prod.twig
Also if I modify prepareForClient() in SQLColumn.php to like this: case "datetime":case "date":case "timestamp": return $value; The view_item will show datetime correctly, but the edit_item will be screwed. If I change it back to then edit_item will show correctly but view_item will be wrong. Hopefully someone sees this and can help fix this datetime issue, this is a wonderful project but such a pity...
follow up:
- add the attached file (taken and modified from https://angular-ui.github.io/bootstrap/versioned-docs/0.13.0/) to static/crudkit/js (remove the .txt extension)
- add the include in requires_prod.twig:
-
in DateTimeForItem.php, change renderInternal to this: public function renderInternal() { $directives = $this->getAngularDirectives (); return <<<COMP
COMP; }<input type="text" class="form-control" datepicker-popup="{{format}}" $directives is-open="opened" datepicker-options="dateOptions" date-disabled="disabled(date, mode)" ng-required="true" close-text="Close" />
-
now the datepicker will show as a pop-up when button pressed, and editing datetime would work.
- Still can't find a way to fix prepareForClient() in SQLColumn.php so that View and Edit datetime can both work.