Skip to content

Conversation

@mmsommer
Copy link
Contributor

@mmsommer mmsommer commented May 8, 2014

Added configurability to datepicker_input and filter_data_range_input as suggested in #3123

@shekibobo
Copy link
Contributor

This does nothing to ensure the datepicker format matches the strftime format. The code to initialize the datepicker input:

  # jQuery datepickers (also evaluates dynamically added HTML)
  $(document).on 'focus', '.datepicker:not(.hasDatepicker)', ->
    defaults = dateFormat: 'yy-mm-dd'
    options = $(@).data 'datepicker-options'
    $(@).datepicker $.extend(defaults, options)

Any thoughts on how we could make sure those match up automatically? If you wanted to make your selected dates to match your I18n format, there would have to be some kind of conversion.

@mmsommer
Copy link
Contributor Author

mmsommer commented May 8, 2014

@shekibobo yes, that is true. Isn't there a possibility to transform a ruby format to a javascript format by using coffeescript?

@shekibobo
Copy link
Contributor

There has been some discussion related to that point on #3000. I haven't come up with a solution yet, but would love your input.

@seanlinsley
Copy link
Contributor

The test suite should start working again if you rebase on master.

@seanlinsley
Copy link
Contributor

My bad, you'll need to rebase one more time.

@timoschilling
Copy link
Member

Why do you use diverent keys in datepicker_input.rb (date.formats.default) and in application.js.coffee.erb (active_admin.datepickers.date_format)?

I think all should use the same key. There could be a config option like date_format_key.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't work, the application.js.coffee.erb is only compiled once and not for each locale

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants