Search and Top Navigation
#6829 closed enhancement (wontfix)
Opened January 11, 2011 10:54AM UTC
Closed January 11, 2011 01:41PM UTC
Last modified January 11, 2011 03:52PM UTC
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");
Attachments (0)
Change History (3)
Changed January 11, 2011 01:41PM UTC by comment:1
resolution: | → wontfix |
---|---|
status: | new → closed |
Changed January 11, 2011 03:44PM UTC by comment:2
Replying to [comment:1 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.
Changed January 11, 2011 03:52PM UTC by comment:3
Datepicker's API is not good. It's going to be completely redone.
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.