Skip to content

Problems with the picker datetime #2408

@emartinezpangaea

Description

@emartinezpangaea

I try to define a picker datetime, but is render as a picker date. I attached a section of my code as example.
On Firefox navigator, the input with the default datetime is correctly shown, but when I click the picker only is shown a date picker without option to change the time, and after that if you try to save the form the following error is returned "Not a valid datetime value."
In theory the picker datetime is supported.
Please, could you provide a solution?.

Column definition in the Model:

import datetime
from sqlalchemy import Column, DateTime
from sqlalchemy.sql import functions

class Data(Model): 
    #could be collected in previous days and different time
    created_on = Column(DateTime, default=datetime.datetime.now, server_default=functions.current_timestamp(), nullable=False)   
    ...

View definition

from flask_appbuilder import ModelView
from flask_appbuilder.models.sqla.interface import SQLAInterface

class DataModelView(ModelView):  
    datamodel = SQLAInterface(Data)    
    ...
    edit_columns = ["comments", 'created_on]
    ...

screenshots

Image Image Image Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions