Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#6829 closed enhancement (wontfix)

Ability to use setDate date with any date not just "Today"

Reported by: nobelisp Owned by:
Priority: minor Milestone: 1.9.0
Component: ui.datepicker Version: 1.8.7
Keywords: Cc:
Blocked by: Blocking:

Description

The ability to use setDate to add days, month and years is really useful as Javascript's setDate function does not work over month barriers.

Propose enhancing the setDate function to be able to modify any given date and not just "Today".

Example: var dt = $("#datePicker1"); dt.datepicker("setDate", [dateObject or string], "+7d");

If you wanted to add 7 days to the currently selected date then: dt.datepicker("setDate", dt.getDate(), "+7d");

Change History (3)

comment:1 Changed 9 years ago by Scott González

Resolution: wontfix
Status: newclosed

This should live in a lower-level date utility, which datepicker should be built on top of. The datepicker widget shouldn't expose that functionality through its own API.

comment:2 in reply to:  1 Changed 9 years ago by nobelisp

Replying to scott.gonzalez:

This should live in a lower-level date utility, which datepicker should be built on top of. The datepicker widget shouldn't expose that functionality through its own API.

Agreed, however what is the lower-level date utility for JQuery? Secondly why provide such a feature as +5d but only allow it to be applicable to Today? and not the currently selected date or any date for that matter.

Lastly if you were so strict about not duplicating lower level date functionality why provide formatDate under datepicker?

I think there is great potential for setDate modifiers to be applicable to a date and especially when you are using two instances to provide from and two dates.

comment:3 Changed 9 years ago by Scott González

Datepicker's API is not good. It's going to be completely redone.

Note: See TracTickets for help on using tickets.