JQuery datepicker - Selecting the last day of the month -


in report generator wrote user can select date range display results for. since data report generated monthly day portion of date range irrelevant. have requirement change day of selected start date '1' regardless of user has selected. i've done so:

$('#textstartdate').datepicker({ maxdate: "+0m", mindate: "-24m", dateformat: 'm/1/yy' }); 

the second pard of requirement day of selected end date set last day of month regardless of day selected. if user selected end date of 5/16/2011 date field show 5/31/2011. stuck.

any appreciated.

the consistent technique have found is:

  1. add 1 month select day
  2. round first day of month
  3. subtract 1 day.

    not pretty, works.

plan b:

  1. round first of selected month
  2. add 1 month
  3. subtract 1 day

note: working on quick sample code add later


Comments

Popular posts from this blog

c# - how to write client side events functions for the combobox items -

exception - Python, pyPdf OCR error: pyPdf.utils.PdfReadError: EOF marker not found -