Created
April 28, 2018 19:56
-
-
Save dangrossman/8c6747b82572bc860364f17258004dbb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="reportrange" style="background: #fff; cursor: pointer; padding: 5px 10px; border: 1px solid #ccc; width: 100%"> | |
<i class="fa fa-calendar"></i> | |
<span></span> <i class="fa fa-caret-down"></i> | |
</div> | |
<script type="text/javascript"> | |
$(function() { | |
var start = moment().subtract(29, 'days'); | |
var end = moment(); | |
function cb(start, end) { | |
$('#reportrange span').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY')); | |
} | |
$('#reportrange').daterangepicker({ | |
startDate: start, | |
endDate: end, | |
ranges: { | |
'Today': [moment(), moment()], | |
'Yesterday': [moment().subtract(1, 'days'), moment().subtract(1, 'days')], | |
'Last 7 Days': [moment().subtract(6, 'days'), moment()], | |
'Last 30 Days': [moment().subtract(29, 'days'), moment()], | |
'This Month': [moment().startOf('month'), moment().endOf('month')], | |
'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')] | |
} | |
}, cb); | |
cb(start, end); | |
}); | |
</script> |
How to add place holder
First show place holder all data showing in the table How
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How can I access the value of the reportrange div in flask?