Skip to content

Commit 1e07214

Browse files
committed
add icon
1 parent 68a6efc commit 1e07214

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

adminlteui/templates/adminlte/date_range_filter.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
{% get_current_language as LANGUAGE_CODE %}
33

44
<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>
68
<input id="id_filter_{{ field_name }}__gte" hidden type="text">
79
<input id="id_filter_{{ field_name }}__lte" hidden type="text">
810

@@ -37,12 +39,12 @@
3739
endDate : moment()
3840
},
3941
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 }}') + ' ')
4143
}
4244
);
4345
// act on date range selection via widget
4446
$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 }}') + ' ')
4648
$('#id_filter_{{ field_name }}__gte').attr('name', '{{ field_name }}__gte').val(picker.startDate.format('YYYY-MM-DD'));
4749
$('#id_filter_{{ field_name }}__lte').attr('name', '{{ field_name }}__lte').val(picker.endDate.format('YYYY-MM-DD'));
4850
});
@@ -61,7 +63,7 @@
6163
picker.setEndDate(moment(vals[1], 'YYYY-MM-DD'));
6264
$('#id_filter_{{ field_name }}__gte').attr('name', '{{ field_name }}__gte').val(vals[0]);
6365
$('#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 }}') + ' '));
6567
}
6668
}
6769
});

0 commit comments

Comments
 (0)