simov / express-admin

MySQL, MariaDB, PostgreSQL, SQLite admin for Node.js
MIT License
1.17k stars 223 forks source link

timestamp field considered "malformed" by front end app #74

Closed scottlingran closed 9 years ago

scottlingran commented 9 years ago

I have a created_at field in my postgres database, the type is timestamp with time zone.

However, this is rendered as a string in the frontend admin app and considered "malformed".

This also blocks any saves that can be made.

How can I resolve this issue?


screen shot 2014-09-10 at 9 06 29 pm

scottlingran commented 9 years ago

Ok so the workaround I used is to disable editing the timestamp inputs.

"editview": {
  "show": false
}

Would be great if express-admin had some html input for timestamp fields.

simov commented 9 years ago

Hi @locksley

You can configure your timestamp column as

"control": {
    "datetime": true
}

You can find all available control types here

For created_at or updated_at columns it's better to update them automatically via events

You can take a look at the created_at/updated_at example

scottlingran commented 9 years ago

Thanks!

simov commented 9 years ago

Btw, @locksley currently there is a bug in the way the datetime columns are being formatted inside the UI. That's just got fixed here https://github.com/simov/express-admin/pull/61 so keep an eye on the project when the new version comes out to npm, or just pull master in the meantime :coffee: