Level 104
the daterangepicker plugin
Which daterangepicker plugin?
anybody can help me with this?
Share the relevant code
HI, I am using the daterangepicker plugin whenever I am changing the date the present date is not coming, anybody can help me with this?
the daterangepicker plugin
Which daterangepicker plugin?
anybody can help me with this?
Share the relevant code
@tykus this the javasript code
var start = ""; var end = ""; start = moment("{{$startdate}}") end = "{{$enddate}}" start = moment().subtract(29, 'days'); end = moment(); $(function() { // alert(start) 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); var startingdate=start.format('YYYY-MM-DD'); var ending=end.format('YYYY-MM-DD'); $("#startdate").val(startingdate); $("#enddate").val(ending); }); // $(document).on("click", "#search", function (e){ function getDate(){ // var requestdate = start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD'); var startingdate=start.format('YYYY-MM-DD'); var ending=end.format('YYYY-MM-DD'); $("#startdate").val(startingdate); // alert(startingdates); $("#enddate").val(ending); } $('#search').click(function(){ console.log(start.format('D MMMM YYYY') + ' - ' + end.format('D MMMM YYYY')); });Please or to participate in this conversation.