#9494 closed bug (notabug)
inst.drawMonth & inst.drawYear can't set on beforeShow
Reported by: | ZardoZAntony | Owned by: | ZardoZAntony |
---|---|---|---|
Priority: | minor | Milestone: | none |
Component: | ui.datepicker | Version: | 1.10.3 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
need fix.
fix example:
_showDatepicker { ... inst.drawMonth = inst.drawYear = -1; beforeShow = $.datepicker._get(inst, "beforeShow"); .. } _setDateFromField{ ... if (inst.drawMonth == -1) inst.drawMonth = inst.selectedMonth = date.getMonth(); else inst.selectedMonth = inst.drawMonth; if (inst.drawYear == -1) inst.drawYear = inst.selectedYear = date.getFullYear(); else inst.selectedYear = date.getFullYear(); //inst.drawMonth = inst.selectedMonth = date.getMonth(); //inst.drawYear = inst.selectedYear = date.getFullYear(); }
Change History (8)
comment:1 Changed 9 years ago by
Owner: | set to ZardoZAntony |
---|---|
Status: | new → pending |
comment:3 Changed 9 years ago by
Status: | new → pending |
---|
What made you think you were allowed to set those?
comment:4 follow-up: 5 Changed 9 years ago by
Status: | pending → new |
---|
Why not? And how i can set first draw month some other way? I show 3 months. The current date is in the middle.
comment:5 Changed 9 years ago by
Resolution: | → notabug |
---|---|
Status: | new → closed |
The documentation makes it seem like this should be possible, but beforeShow
is a bizarre API so I'm not sure there's much we could do to clarify that it isn't. After the widget factory rewrite there will be an open event that can be used as a hook to set options.
Replying to ZardoZAntony:
Why not? And how i can set first draw month some other way? I show 3 months. The current date is in the middle.
This seems like a reasonable feature request. Feel free to open another ticket for that and we might make that possible as part of the rewrite. Here's a hack-tastic way of accomplishing it http://jsfiddle.net/tj_vantoll/wmm2n/.
comment:6 follow-up: 7 Changed 9 years ago by
I don't see what makes it seem like this should be possible. Properties directly on the instance are private, they're never mention anywhere in the docs. It sounds like you're looking for the showCurrentAtPos option.
comment:7 Changed 9 years ago by
Replying to scott.gonzalez:
I don't see what makes it seem like this should be possible. Properties directly on the instance are private, they're never mention anywhere in the docs. It sounds like you're looking for the showCurrentAtPos option.
Since drawMonth
and other properties are on the object passed to beforeShow
I could see thinking that you could set any of them. Datepicker has enough options that it's hard to know what's internal and what isn't. I clearly forgot about showCurrentAtPos
for instance :P
comment:8 Changed 9 years ago by
I forget that the instance is passed around in datepicker :-/ The rewrite can't come soon enough.
Hi ZardoZAntony,
Thanks for taking the time to contribute to the jQuery UI project. Can you please provide a test case that shows the problem that you are experiencing? You can use this as a starting point - http://jsfiddle.net/tj_vantoll/tRdpr/.