README.md in active_admin_datetimepicker-0.3.0 vs README.md in active_admin_datetimepicker-0.4.0
- old
+ new
@@ -55,18 +55,25 @@
}
# This if for backend(Ruby)
ActiveAdminDatetimepicker::Base.format = "%Y-%m-%d %H:%M:%S"
```
+## Change datetime format
+If you want to change format - you need to make sure that front-end and back-end formats are identical. And remember JS and Ruby datetime format has different syntax.
-See [the datetimepicker documentation for more details](http://xdsoft.net/jqplugins/datetimepicker/).
+Create configuration file '/config/initializers/init_datetimpicker.rb'
+```ruby
+# Example "11/03/2016 13:00"
+ActiveAdminDatetimepicker::Base.default_datetime_picker_options = {
+ format: 'd/m/Y H:i', # JS format
+ defaultTime: proc { Time.current.strftime('%H:00') } # not necessary
+}
+ActiveAdminDatetimepicker::Base.format = "%d/%m/%Y %H:%M" # Ruby format
+```
-## Development
+See [the datetimepicker documentation for more details](http://xdsoft.net/jqplugins/datetimepicker/).
-After checking out the repo, run `bin/setup` to install dependencies. Then, run `bin/console` for an interactive prompt that will allow you to experiment.
-
-To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release` to create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
## Contributing
1. Fork it ( https://github.com/activeadmin-plugins/activeadmin_datetimepicker/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)