The monthpicker widget should always be inside the page

If the input field is on the very right of the window, before the monthpicker would only partially fit in the window. Some parts where cut off.

This checks if there is enough space on the right of the input field to display the monthpicker. If not enough space is available, it will move the widget to the left of the input field.