dpgaspar / Flask-AppBuilder

Simple and rapid application development framework, built on top of Flask. includes detailed security, auto CRUD generation for your models, google charts and much more. Demo (login with guest/welcome) - http://flaskappbuilder.pythonanywhere.com/
BSD 3-Clause "New" or "Revised" License
4.71k stars 1.36k forks source link

DateTimePickerWidget shows only the date picker and not the time picker #2250

Open andreamancini-work opened 5 months ago

andreamancini-work commented 5 months ago

Environment

Flask-Appbuilder version:

pip freeze output: alembic==1.13.1 annotated-types==0.7.0 anyio==4.4.0 apispec==6.6.1 asgiref==3.8.1 attrs==23.2.0 Babel==2.15.0 blinker==1.8.2 certifi==2024.6.2 charset-normalizer==3.3.2 click==8.1.7 colorama==0.4.6 Deprecated==1.2.14 dnspython==2.6.1 email_validator==2.1.1 exceptiongroup==1.2.1 fastapi==0.111.0 fastapi-cli==0.0.4 Flask==2.3.3 Flask-AppBuilder==4.4.1 Flask-Babel==2.0.0 Flask-JWT-Extended==4.6.0 Flask-Limiter==3.6.0 Flask-Login==0.6.3 Flask-Migrate==4.0.5 Flask-SQLAlchemy==2.5.1 Flask-WTF==1.2.1 greenlet==3.0.3 h11==0.14.0 httpcore==1.0.5 httptools==0.6.1 httpx==0.27.0 idna==3.7 importlib_resources==6.4.0 itsdangerous==2.2.0 Jinja2==3.1.4 jsonschema==4.22.0 jsonschema-specifications==2023.12.1 limits==3.11.0 Mako==1.3.5 markdown-it-py==3.0.0 MarkupSafe==2.1.5 marshmallow==3.21.2 marshmallow-sqlalchemy==0.28.2 mdurl==0.1.2 numpy==1.26.4 ordered-set==4.1.0 orjson==3.10.5 packaging==24.0 pandas==2.0.3 pi==0.1.2 prison==0.2.1 psycopg2-binary==2.9.9 pydantic==2.7.4 pydantic_core==2.18.4 Pygments==2.18.0 PyJWT==2.8.0 python-dateutil==2.9.0.post0 python-dotenv==1.0.1 python-multipart==0.0.9 pytz==2024.1 PyYAML==6.0.1 referencing==0.35.1 requests==2.32.3 rich==13.7.1 rpds-py==0.18.1 shellingham==1.5.4 six==1.16.0 sniffio==1.3.1 SQLAlchemy==1.4.52 SQLAlchemy-Utils==0.41.2 starlette==0.37.2 typer==0.12.3 typing_extensions==4.11.0 tzdata==2024.1 ujson==5.10.0 urllib3==2.2.1 uvicorn==0.30.1 uvloop==0.19.0 watchfiles==0.22.0 websockets==12.0 Werkzeug==3.0.3 wrapt==1.16.0 WTForms==3.1.2

Describe the expected results

Shortly, when I use DateTimeField with a DateTimePickerWidget I see only the calendar tool and not the time picker as you can see in the attached image.

add_form_extra_fields = {
        'contract_date': DateTimeField('Contract Date', default=datetime.today, validators=[DataRequired()],
                                       widget=DateTimePickerWidget())
    }
datetimepicker
fedepad commented 1 month ago

To put this in context, #1698 doesn't work anymore because of the changes here:
https://github.com/dpgaspar/Flask-AppBuilder/pull/2144/files#diff-63f02f325b5cd61a4425f74404d33465b742b6ddc18161ab41192e53a72429e1

The option pickTime doesn't exist in the new bootstrap-datepicker used (https://github.com/uxsolutions/bootstrap-datepicker/tree/master) and it looks that the new date picker introduced in https://github.com/dpgaspar/Flask-AppBuilder/pull/2144/files#diff-63f02f325b5cd61a4425f74404d33465b742b6ddc18161ab41192e53a72429e1 has no option for datetime (date + time).

The previously used bootstrap-datetimepicker is archived (https://github.com/smalot/bootstrap-datetimepicker) and the continued one is located here: https://getdatepicker.com/ For example what was here before, could have been moved to https://getdatepicker.com/5-3/ or https://getdatepicker.com/4/ if using still Bootstrap 3 in this repo or adapted to the newest one if possible, which has even less dependencies.

FYI @dpgaspar or someone else...