Some mediocre Javascript for report thing.

This commit is contained in:
James Cole 2015-12-04 06:56:59 +01:00
parent 55be174037
commit 0b5c5b2ae9

View File

@ -1,11 +1,16 @@
/* globals google, expenseRestShow:true, incomeRestShow:true, year, shared, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */
/* globals google, picker:true, minDate, expenseRestShow:true, incomeRestShow:true, year, shared, month, hideTheRest, showTheRest, showTheRestExpense, hideTheRestExpense, columnChart, lineChart, stackedColumnChart */
$(function () {
"use strict";
drawChart();
$('#inputDateRange').daterangepicker(
picker = $('#inputDateRange').daterangepicker(
{
locale: {
format: 'YYYY-MM-DD',
firstDay: 1,
},
minDate: minDate,
drops: 'up',
}
@ -13,6 +18,8 @@ $(function () {
$('.openModal').on('click', openModal);
$('.date-select').on('click',preSelectDate);
// click open the top X income list:
$('#showIncomes').click(showIncomes);
@ -20,6 +27,15 @@ $(function () {
$('#showExpenses').click(showExpenses);
});
function preSelectDate(e) {
"use strict";
var link = $(e.target);
var picker = $('#inputDateRange').data('daterangepicker');
picker.setStartDate(link.data('start'));
picker.setEndDate(link.data('end'));
return false;
}
function drawChart() {
"use strict";