README.md in active_admin_datetimepicker-0.1.0 vs README.md in active_admin_datetimepicker-0.1.1
- old
+ new
@@ -1,9 +1,12 @@
# ActiveAdminDatetimepicker
Adds ability to use XDSoft's DateTime picker as the date_time_picker input for forms, and date_time_range for filters
+
+![ActiveAdminDatetimepicker](https://raw.githubusercontent.com/ActiveAdminPlugins/activeadmin_datetimepicker/master/screen/screen.png "ActiveAdminDatetimepicker")
+
## Installation
Add this line to your application's Gemfile:
```ruby
@@ -30,19 +33,31 @@
```@import "active_admin_datetimepicker";```
```ruby
form do |f|
- f.input :starts_at, as: :datepicker, datepicker_options: { min_date: "2013-10-8", max_date: "+3D" }
- f.input :ends_at, as: :datepicker, datepicker_options: { min_date: 3.days.ago.to_date, max_date: "+1W +5D" }
+ f.input :starts_at, as: :date_time_picker, datepicker_options: { min_date: "2013-10-8", max_date: "+3D" }
+ f.input :ends_at, as: :date_time_picker, datepicker_options: { min_date: 3.days.ago.to_date, max_date: "+1W +5D" }
end
```
```ruby
filter :created_at, as: :date_time_range
```
+
+## Override behaviour in initializer
+```ruby
+# This if for front-end javascript side
+ActiveAdminDatetimepicker::Base.default_datetime_picker_options = {
+ defaultDate: proc { Time.current.strftime("%Y-%m-%d 00:00") }
+}
+# This if for backend(Ruby)
+ActiveAdminDatetimepicker::Base.format = "%Y-%m-%d %H:%M:%S"
+```
+
+
See [the datetimepicker documentation for more details](http://xdsoft.net/jqplugins/datetimepicker/).
## Development
@@ -50,10 +65,10 @@
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/[my-github-username]/active_admin_datetimepicker/fork )
+1. Fork it ( https://github.com/activeadmin-plugins/activeadmin_datetimepicker/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request