Comments (14)
Hey, thanks for reporting this.
I think maybe a better approach would be to use a Bootstrap DateTime picker and not depend on the browser supports? What do you think?
If you also would like feel free to make a PR for it.
from sqladmin.
Even here it says it should be supported: caniuse.com/input-datetime
But it's the type="datetime-local"
supported, not type="datetime"
:
from sqladmin.
yeah I think it is deprecated, and as I checked the datetime-local
is not fully supported, so we can change this to datetime-local
and also add a UI library? But one should be enough.
from sqladmin.
I noticed tabler
use litepicker
as date form picker, But๐:
from sqladmin.
@ischaojie Can we still use litepicker and then switch to the new one when tabler switches?
from sqladmin.
The reason is <input type="datetime">
still has almost no support in modern browsers, So It's better to use datetime-local
:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/datetime-local
Can we add DatetimeLocalField
or some?
from sqladmin.
BTW, what browser and what version are you using?
from sqladmin.
BTW, what browser and what version are you using?
I using chrome 102.0.5005.61
from sqladmin.
hmm.I'm using chrome 101.x.x and it's working alright. weird though.
from sqladmin.
Weird, the code is like this:
class User(Base):
__tablename__ = "users"
id = Column(Integer, primary_key=True)
name = Column(String)
age = Column(Integer)
created_at = Column(DateTime, default=datetime.now())
Base.metadata.create_all(engine) # Create tables
app = FastAPI()
admin = Admin(app, engine)
class UserAdmin(ModelAdmin, model=User):
column_list = [User.id, User.name, User.age]
admin.register_model(UserAdmin)
from sqladmin.
Even here it says it should be supported: https://caniuse.com/input-datetime
from sqladmin.
I change the code like this:
@converts("DateTime")
def conv_DateTime(
self, model: type, prop: ColumnProperty, kwargs: Dict[str, Any]
) -> UnboundField:
kwargs.setdefault("format", "%Y-%m-%dT%H:%M:%S")
return DateTimeLocalField(**kwargs)
I reading the Mozilla doc, Looks like type=datetime
has been removed๏ผ
One thing the datetime-local input type doesn't provide is a way to set the time zone and/or locale of the date/time control. This was available in the datetime input type, but this type is now obsolete, having been removed from the spec.
from sqladmin.
@ischaojie Can we still use litepicker and then switch to the new one when tabler switches?
litepicker
didn't support choosing time
, but new easepick supports it.
see: wakirin/Litepicker#1
Or use another lib. or wait for tabler
to support it ๐
from sqladmin.
Added flatpickr to handle Date and DateTimes: #288
from sqladmin.
Related Issues (20)
- TypeError: UUID objects are immutable (fastapi_users) HOT 4
- ValueError on passing unexcepted parameter
- Use HTMX HOT 3
- jinja2.exceptions.TemplateNotFound: list.html HOT 3
- What about Router per View? HOT 2
- with ... as ... statement can make sesssion close,which will lead to DetachedInstanceError HOT 8
- [feature request] Custom login page HOT 1
- Page size selection at bottom sometimes takes the user to non existing page
- Ckeditor <TypeError: Cannot convert undefined or null to object> HOT 1
- Specify particular column to be searched. HOT 1
- sqlalchemy column_property should be ignore when create/update HOT 10
- Internationalization and Localization support HOT 1
- Datetime with timezone edited incorrectly HOT 1
- Image corruption when editing other fields HOT 2
- Adding custom filtering for relationships ModelConverterBase._prepare_select_options
- Redirect to custom url after creation HOT 1
- Support for pgvector.sqlalchemy.vector.VECTOR field support HOT 1
- Document update may be required to resolve DeprecationWarning from Starlette HOT 1
- deferred=True which will lead to DetachedInstanceError HOT 3
- Mark the field as non-linked
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sqladmin.