FIX: pagination
This commit is contained in:
parent
8794f3e324
commit
961fea97a0
|
@ -13,7 +13,8 @@ EventBillingList = (function () {
|
|||
await load_events(0);
|
||||
$(".event_billing_list_load").off("click").on("click", load_events);
|
||||
$("#event_billing_list_num_of_res").on("change", function(){
|
||||
limit = $("#eventlist_num_of_res option:selected").data("num");
|
||||
limit = $("#event_billing_list_num_of_res option:selected").data("num");
|
||||
pag.set_limit(limit);
|
||||
load_events();
|
||||
});
|
||||
};
|
||||
|
@ -135,11 +136,12 @@ EventBillingList = (function () {
|
|||
}
|
||||
|
||||
await Promise.all(event_loading_queue).then((values) => {
|
||||
$("#event_billing_list_accordion").empty();
|
||||
for(val of values){
|
||||
$("#event_billing_list_accordion").append(templates.eb_list_card(val))
|
||||
}
|
||||
$("#event_billing_list_accordion").show();
|
||||
pag.render(values.length, offset);
|
||||
pag.render(data.total_event_count, offset);
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,6 +9,9 @@ class Pagination{
|
|||
this.dest = destination;
|
||||
this.callback = callback;
|
||||
}
|
||||
set_limit(limit){
|
||||
this.limit = limit;
|
||||
}
|
||||
render(total_count, offset){
|
||||
this.total_count = total_count;
|
||||
this.offset = offset;
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
<label for="event_billing_list_start_datetime"
|
||||
class="col-auto col-form-label font-weight-bold">Zeitraum:</label>
|
||||
<div class="col-auto">
|
||||
<input type="date" class="form-control" id="event_billing_list_start_datetime">
|
||||
<input type="date" class="form-control" id="event_billing_list_start_datetime" value="2000-01-01">
|
||||
</div>
|
||||
<label for="event_billing_list_end_datetime"
|
||||
class="col-auto col-form-label font-weight-bold">bis:</label>
|
||||
|
|
|
@ -65,11 +65,7 @@ pub fn read_events(
|
|||
}
|
||||
},
|
||||
None => {
|
||||
if states.is_some(){
|
||||
Local::now().naive_local() - Duration::days(365)
|
||||
}else{
|
||||
Local::now().naive_local()
|
||||
}
|
||||
Local::now().naive_local()
|
||||
}
|
||||
};
|
||||
let end = match end {
|
||||
|
|
Loading…
Reference in New Issue