Closed workgena closed 9 years ago
@workgena , can you pls make it more DRY?
@Fivell, check new version
@workgena , please squash you commits in single one
With this PR now it is possible to override options. For example if you need date-time with seconds, all you need is to add file
/config/initializer/active_admin_datetimepicker.rb
# This if for fornt-end javascript side
ActiveAdminDatetimepicker::Base.default_datetime_picker_options = {
format: 'Y-m-d H:i:s',
defaultDate: proc { DateTime.now.utc.strftime('%y-%m-%d') }
}
# This if for backend(Ruby)
ActiveAdminDatetimepicker::Base.format = "%Y-%m-%d %H:%M:%S"
"default_datetime_picker_options" is XDSoft's DateTime picker options. So you can pass any other options same way. Full options list: http://xdsoft.net/jqplugins/datetimepicker/
I recomend add this to README.
:+1:
Fix bug when DateTimeRangeInput does not has datepicker_options. In same way as single-DateTimePickerInput.