Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

326
Views
daterangepicker seleccionar rango dentro de un mes

Usando este http://www.daterangepicker.com/

Cómo usar daterangepicker para seleccionar el rango de solo un mes. Habilitar singleDatePicker: true lo convierte en un selector de fechas, pero necesito un rango de un mes.

es decir, del 1 de enero de 2017 al 15 de enero de 2017. o cualquier rango dentro de un mes.

Yo he tratado

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

Pero selecciona del 1 al 31 de enero y el 1 de febrero también.

Si no es posible, sugiera una alternativa.

Editar (código actual)

 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);

ingrese la descripción de la imagen aquí

about 4 years ago · Santiago Trujillo
3 answers
Answer question

0

Simplemente agregue lo siguiente en la opción dateLimit.

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

0

Sé que llego tarde, pero esta solución funciona para mí:

Agregue esta línea a las opciones:

 linkedCalendars: false

y ellos agregan esto al css:

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

La clase padre ( dp-calendar en mi caso) podría ser diferente, verifíquelo con el inspector.

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

about 4 years ago · Santiago Trujillo Report

0

Encontré otro complemento con muchas funciones y la función que necesitaba. https://longbill.github.io/jquery-date-range-picker/

Opción: Modo de un solo mes (con rango de fechas)

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!