Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

328
Visualizações
daterangepicker select range within one month

Using this http://www.daterangepicker.com/

How to use daterangepicker to select range from only one month. Enabling singleDatePicker: true makes it onlt date picker, but I need range for one month.

i.e. for jan 1 2017 to jan 15 2017. or any range within a month.

I have tried

"dateLimit": {
    "month": 1
 },

But it select jan 1 to 31 and feb 1 also.

If not possible please suggest an alternative.

Edit (Current Code)

function cb(start, end) {
            $('#daterange span').html(start.format('MMM D, YYYY') + ' - ' + end.format('MMM D, YYYY'));

            enroll_date_start.value = start.format('YYYY-MM-DD');
            enroll_date_end.value   = end.format('YYYY-MM-DD');
        }

        $('#daterange').daterangepicker({
            maxDate: moment(),

            "dateLimit": {
                "month": 1
            },
            ranges: {
               'Today': [moment(), moment()],
               'This Month': [moment().startOf('month'), moment().endOf('month')],
               'Last Month': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
            }
        }, cb);

enter image description here

about 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Simply add the following in the dateLimit option.

dateLimit: {
    'months': 1,
    'days': -1
}
about 4 years ago · Santiago Trujillo Relatório

0

I know that I'm late but this solution works for me:

Add this line to options:

linkedCalendars: false

and them add this to the css:

.drp-calendar.right {
    display: none !important;
  }

The father class (drp-calendar in my case) could be different, check it with inspector.

Source: https://github.com/dangrossman/daterangepicker/issues/1152#issuecomment-229439154

about 4 years ago · Santiago Trujillo Relatório

0

I found another plugin with a lot of features and the feature I needed. https://longbill.github.io/jquery-date-range-picker/

Option: Single Month Mode (with range dates)

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda