|
2 | 2 | {% get_current_language as LANGUAGE_CODE %} |
3 | 3 |
|
4 | 4 | <div class="form-group" style="margin-bottom: 5px;"> |
5 | | - <button id="id_filter_{{ field_name }}" type="button" class="btn btn-default pull-right"><span>{{ title }} </span><i class="fa fa-caret-down"></i></button> |
| 5 | + <button id="id_filter_{{ field_name }}" type="button" class="btn btn-default pull-right"> |
| 6 | + <i class="fa fa-calendar"></i><span> {{ title }} </span><i class="fa fa-caret-down"></i> |
| 7 | + </button> |
6 | 8 | <input id="id_filter_{{ field_name }}__gte" hidden type="text"> |
7 | 9 | <input id="id_filter_{{ field_name }}__lte" hidden type="text"> |
8 | 10 |
|
|
37 | 39 | endDate : moment() |
38 | 40 | }, |
39 | 41 | function (start, end) { |
40 | | - $drp_input.find('span').html(start.format('{{ choices.0.date_format }}') + ' - ' + end.format('{{ choices.0.date_format }}') + ' ') |
| 42 | + $drp_input.find('span').html(' ' + start.format('{{ choices.0.date_format }}') + ' - ' + end.format('{{ choices.0.date_format }}') + ' ') |
41 | 43 | } |
42 | 44 | ); |
43 | 45 | // act on date range selection via widget |
44 | 46 | $drp_input.on('apply.daterangepicker', function(ev, picker) { |
45 | | - $drp_input.find('span').html(picker.startDate.format('{{ choices.0.date_format }}') + ' - ' + picker.endDate.format('{{ choices.0.date_format }}') + ' ') |
| 47 | + $drp_input.find('span').html(' ' + picker.startDate.format('{{ choices.0.date_format }}') + ' - ' + picker.endDate.format('{{ choices.0.date_format }}') + ' ') |
46 | 48 | $('#id_filter_{{ field_name }}__gte').attr('name', '{{ field_name }}__gte').val(picker.startDate.format('YYYY-MM-DD')); |
47 | 49 | $('#id_filter_{{ field_name }}__lte').attr('name', '{{ field_name }}__lte').val(picker.endDate.format('YYYY-MM-DD')); |
48 | 50 | }); |
|
61 | 63 | picker.setEndDate(moment(vals[1], 'YYYY-MM-DD')); |
62 | 64 | $('#id_filter_{{ field_name }}__gte').attr('name', '{{ field_name }}__gte').val(vals[0]); |
63 | 65 | $('#id_filter_{{ field_name }}__lte').attr('name', '{{ field_name }}__lte').val(vals[1]); |
64 | | - $drp_input.find('span').html((moment(vals[0], 'YYYY-MM-DD').format('{{ choices.0.date_format }}') + ' - ' + moment(vals[1], 'YYYY-MM-DD').format('{{ choices.0.date_format }}') + ' ')); |
| 66 | + $drp_input.find('span').html(' ' + (moment(vals[0], 'YYYY-MM-DD').format('{{ choices.0.date_format }}') + ' - ' + moment(vals[1], 'YYYY-MM-DD').format('{{ choices.0.date_format }}') + ' ')); |
65 | 67 | } |
66 | 68 | } |
67 | 69 | }); |
|
0 commit comments