• Date Range Picker



    <input type="text" name="daterange" id="daterange" class="form-control"  />


    <script>

    //Date Range picker

        $('#daterange').daterangepicker({

    locale: {

                format: 'Y-M-D',

    separator: " to "

            },

    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')]

            }

        });

    </script> 

    Get Start and End Date from Date Range

    <?php $daterange = explode('to',$this->input->post('daterange'));

    $startDate = $daterange[0];

    $endDate = $daterange[1];

    ?>

  • 0 comments:

    Post a Comment

    FAVOURITE LINE

    To steal ideas from one is plagiarism. To steal from many is Research.

    ADDRESS

    Mumbai , Maharashtra

    EMAIL

    shikha.pathak6@gmail.com
    shikha.the.swt.pari@gmail.com

    Skype

    shikha_pari