var d 	= new Date();
var nd 	= new Date(d.getFullYear(),d.getMonth(),d.getDate()+1,d.getHours()-1,d.getMinutes(),d.getSeconds());
$(function() {

    function cb(start, end) {
        $('#searchProductFromDate').html(start.format('MMMM D, YYYY') + ' - ' + end.format('MMMM D, YYYY'));
    }
    cb(moment().subtract(29, 'days'), moment());
    $('#searchProductFromDate').daterangepicker({
        ranges: {
           [lblToday]: [moment(), moment()],
           [lblYesterday]: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
           [lblLast7Days]: [moment().subtract(6, 'days'), moment()],
           [lblLast30Days]: [moment().subtract(29, 'days'), moment()],
           [lblThisMonth]: [moment().startOf('month'), moment().endOf('month')],
           [lblLastMonth]: [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
        },
		 locale: {
          cancelLabel: cancelLabel,
          applyLabel: applyLabel,
		  customRangeLabel: customRangeLabel
      }
    }, cb);
 

});
	
$('#submitProductReviewSearch').click(function(){
	if((jQuery.trim($('#searchProductName').val()) == '') && ($('#searchProductFromDate').val() == '' ) && (jQuery.trim($('#searchUserName').val()) == '') && ($('#status').val()=='')){
		jAlert(msgSelectSearchCriteria);
		return false;
	}
});