11# active_admin_date_range_preset
2- Preset links for ActiveAdmin date_range inputs
32
4- This is JS-CSS add-on over inputs filter_date_range in sidebar filters
5-
6- Use it as example and modify for your needs.
3+ Preset links for ActiveAdmin date_range inputs in sidebar filters in forms
74
85This is how it looks like
96
107![ Step 1] ( /screen/step_1.jpg )
118
129![ Step 2] ( /screen/step_2.jpg )
1310
14-
1511## Installation
1612
1713Add this line to your application's Gemfile:
@@ -47,7 +43,7 @@ f.input :date_from, as: :date_time_picker, wrapper_html: { class: 'datetime_pres
4743f.input :date_to , as: :date_time_picker
4844```
4945
50- Input can be "as : string " or any other type compatible with < input type =" text " />
46+ Input can be "as : string " or any other type compatible with " input type=text"
5147Main point is to set for ferst input-pair wrapper-class
5248
5349``` wrapper_html: { class: 'datetime_preset_pair' } ```
@@ -61,6 +57,7 @@ By default inputs fills with only date("2015-06-12"). If you need time add
6157
6258You can set global defaults in your active_admin.js like this:
6359
60+ ``` javascript
6461# End date will be full- day, not next.
6562# Today true : 2015 - 06 - 12 - 2015 - 06 - 12
6663# Today false: 2015 - 06 - 12 - 2015 - 06 - 13
@@ -70,3 +67,6 @@ $.fn.date_range_ext_preset.defaults.date_to_human_readable = true
7067# Today: 2015 - 06 - 12 00 : 00 : 00 - 2015 - 06 - 13 00 : 00 : 00
7168# Today with human_readable= true: 2015 - 06 - 12 00 : 00 : 00 - 2015 - 16 - 12 23 : 59 : 59
7269$ .fn .date_range_ext_preset .defaults .show_time = true
70+ ```
71+
72+ Set dafaults before $(document).on('ready')
0 commit comments