Opened 5 years ago

Last modified 3 years ago

#9923 open bug

Datepicker: changeMonth combined with showCurrentAtPos

Reported by: Mamen Owned by:
Priority: minor Milestone: none
Component: ui.datepicker Version: 1.10.4
Keywords: Cc:
Blocked by: Blocking:

Description

The options changeMonth and changeYear is visible on the first visible month. However they change the month selected in showCurrentAtPos. This seems very strange. I believe the position of the selects should be in the month selected in showCurrentAtPos.

http://jsfiddle.net/mrmamen/xKBvx/

Change History (4)

comment:1 Changed 5 years ago by tj.vantoll

Status: newopen

I agree that this makes sense. We can take this approach on the rewrite.

comment:2 Changed 5 years ago by Scott González

I think a better change is making the selects behave as expected in their current position. Especially if we're considering #7580,

Are there examples of software or sites that display multiple months to compare this to?

comment:3 Changed 5 years ago by tj.vantoll

Just to note, the rewrite removes the select elements, but provides extension APIs for adding your own.

comment:4 Changed 3 years ago by syryos2

I found a solution for the showCurrentAtPos bug issue:

--- jquery-ui.orig.js	2015-11-23 20:04:52.000000000 +0100
+++ jquery-ui.js	2015-11-23 17:56:37.987111191 +0100
@@ -8815,6 +8815,8 @@
 				origyearshtml = inst.yearshtml = null;
 			}, 0);
 		}
+		// FIX BUG http://bugs.jqueryui.com/ticket/7288
+		inst.drawMonth += this._get(inst, "showCurrentAtPos");
 	},
 
 	// #6694 - don't focus the input if it's already focused
@@ -8940,9 +8942,14 @@
 		if (this._isDisabledDatepicker(target[0])) {
 			return;
 		}
+		// FIX BUG http://bugs.jqueryui.com/ticket/7288
+		/*
 		this._adjustInstDate(inst, offset +
 			(period === "M" ? this._get(inst, "showCurrentAtPos") : 0), // undo positioning
 			period);
+		*/
+		this._adjustInstDate(inst, offset, period);
+
 		this._updateDatepicker(inst);
 	},
 

Note: See TracTickets for help on using tickets.