mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fix dashboard date range labels
This commit is contained in:
parent
e6ea58805c
commit
44e7f9abbb
@ -95,13 +95,15 @@
|
|||||||
// Initialize date range selector
|
// Initialize date range selector
|
||||||
chartStartDate = moment().subtract(29, 'days');
|
chartStartDate = moment().subtract(29, 'days');
|
||||||
chartEndDate = moment();
|
chartEndDate = moment();
|
||||||
|
lastRange = false;
|
||||||
|
|
||||||
if (isStorageSupported()) {
|
if (isStorageSupported()) {
|
||||||
var lastRange = localStorage.getItem('last:dashboard_range');
|
lastRange = localStorage.getItem('last:dashboard_range');
|
||||||
lastRange = dateRanges[lastRange];
|
dateRange = dateRanges[lastRange];
|
||||||
if (lastRange) {
|
|
||||||
chartStartDate = lastRange[0];
|
if (dateRange) {
|
||||||
chartEndDate = lastRange[1];
|
chartStartDate = dateRange[0];
|
||||||
|
chartEndDate = dateRange[1];
|
||||||
}
|
}
|
||||||
|
|
||||||
@if (count($currencies) > 1)
|
@if (count($currencies) > 1)
|
||||||
@ -123,7 +125,10 @@
|
|||||||
$('#reportrange span').html(start.format('{{ $account->getMomentDateFormat() }}') + ' - ' + end.format('{{ $account->getMomentDateFormat() }}'));
|
$('#reportrange span').html(start.format('{{ $account->getMomentDateFormat() }}') + ' - ' + end.format('{{ $account->getMomentDateFormat() }}'));
|
||||||
chartStartDate = start;
|
chartStartDate = start;
|
||||||
chartEndDate = end;
|
chartEndDate = end;
|
||||||
$('.range-label-div').text(label);
|
$('.range-label-div').show();
|
||||||
|
if (label) {
|
||||||
|
$('.range-label-div').text(label);
|
||||||
|
}
|
||||||
loadData();
|
loadData();
|
||||||
|
|
||||||
if (isStorageSupported() && label && label != "{{ trans('texts.custom_range') }}") {
|
if (isStorageSupported() && label && label != "{{ trans('texts.custom_range') }}") {
|
||||||
@ -142,7 +147,7 @@
|
|||||||
ranges: dateRanges,
|
ranges: dateRanges,
|
||||||
}, cb);
|
}, cb);
|
||||||
|
|
||||||
cb(chartStartDate, chartEndDate);
|
cb(chartStartDate, chartEndDate, lastRange);
|
||||||
|
|
||||||
$("#currency-btn-group > .btn").click(function(){
|
$("#currency-btn-group > .btn").click(function(){
|
||||||
$(this).addClass("active").siblings().removeClass("active");
|
$(this).addClass("active").siblings().removeClass("active");
|
||||||
@ -272,7 +277,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;">
|
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;display:none;">
|
||||||
{{ trans('texts.last_30_days') }}
|
{{ trans('texts.last_30_days') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -322,7 +327,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;">
|
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;display:none;">
|
||||||
{{ trans('texts.last_30_days') }}
|
{{ trans('texts.last_30_days') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -354,7 +359,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;">
|
<div class="range-label-div in-thin pull-right" style="color:#337ab7;font-size:16px;display:none;">
|
||||||
{{ trans('texts.last_30_days') }}
|
{{ trans('texts.last_30_days') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user