Skip to content

Datepicker not tracking seconds #2963

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
nullvoids opened this issue Dec 4, 2017 · 2 comments
Closed

Datepicker not tracking seconds #2963

nullvoids opened this issue Dec 4, 2017 · 2 comments

Comments

@nullvoids
Copy link

When updating a table with a datetime field, the datetime field always gets automatically updated because the datepicker is not tracking seconds.

For example:
If you have a Users table with a date_of_birth column set to 12/1/2017 10:00:59 and you go on rails_admin and change the user's email, the date_of_birth column will automatically be changed to 12/1/2017 10:00:00

@sedubois
Copy link
Contributor

sedubois commented Jun 6, 2019

I observe the same issue. Every time I edit an object, its datetime properties get updated with the seconds being stripped away. If I try to manually add the seconds in the date picker text box, they automatically disappear.

Screenshot 2019-06-06 at 14 00 15

Also I don't understand what controls the format of this date picker. I've seen other instances where the seconds did get shown (see the screenshot in #3134 (comment)).

Together with other date picker issues (#3134, #3140), it makes it quite difficult to use RailsAdmin to edit anything.

@sedubois
Copy link
Contributor

sedubois commented Jun 6, 2019

This workaround seems to work (overwrite the time formatting to include seconds).

# config/locales/rails.en.yml
en:
  time:
    formats:
      long: "%Y-%m-%d %H:%M:%S"

# config/locales/rails.fr.yml
fr:
  time:
    formats:
      long: "%Y-%m-%d %H:%M:%S"

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants