New code for new date range thing.

This commit is contained in:
James Cole
2015-03-02 12:35:14 +01:00
parent 6dba916d02
commit 56e36847a5
8 changed files with 83 additions and 83 deletions

View File

@@ -1,6 +1,38 @@
$(function () {
$('.currencySelect').click(currencySelect)
$('.currencySelect').click(currencySelect);
$('#daterange').daterangepicker(
{
ranges: {
'This Month': [moment().startOf('month'), moment().endOf('month')],
'Last Month': [moment().subtract('month', 1).startOf('month'), moment().subtract('month', 1).endOf('month')],
'Next Month': [moment().add('month', 1).startOf('month'), moment().add('month', 1).endOf('month')]
},
opens: 'left',
format: 'DD-MM-YYYY',
startDate: start,
endDate: end
},
function(start, end, label) {
// send post.
$.post(dateRangeURL, {
start: start.format('YYYY-MM-DD'),
end: end.format('YYYY-MM-DD'),
_token: token
}).success(function() {
window.location.reload(true);
}).fail(function() {
alert('Could not change date range');
});
//alert('A date range was chosen: ' + start.format('YYYY-MM-DD') + ' to ' + end.format('YYYY-MM-DD'));
}
);
});
@@ -21,4 +53,5 @@ function currencySelect(e) {
return false;
}
}