trentrichardson / jQuery-Timepicker-Addon

Adds a timepicker to jQueryUI Datepicker
http://trentrichardson.com/examples/timepicker/
MIT License
2.66k stars 1.05k forks source link

Change month updates value #213

Open Asgaroth opened 13 years ago

Asgaroth commented 13 years ago

When changing the month using the next or previous arrows, the input value is updated, this does not happen in the original datepicker widget, (http://jqueryui.com/demos/datepicker/) .

I'm using the widget to filter some data by datetime via ajax, I have an event that observes the changes on the input field, since the input is updated on every month change several ajax calls are made while browsing, even though the user never really choosed a date.

ypapou commented 12 years ago

Also if set showTimepicker property to false then the input isn't updated when changing month (as in original datepicker). This causes different behavior depending on display datetimepicker with time or not. I think that the input should not be updated on changing month in calendar.

Could you please fix this issue?

Luoti commented 12 years ago

Hi!

It's me with my hacky solutions. I know this code is here for a reason, but this hack does work for me. I commented lines 154 - 156 (default onChangeMonthYear) and 159 - 162 (default onClose). So far I haven't found any defects with this approach but I think there are some.

Use with care.

sophistifunk commented 12 years ago

This has been bugging me, too :(

srnjak commented 11 years ago

I found where is bug for this issue.

Line 827 var dt = $.datepicker._daylightSavingAdjust(new Date(dp_inst.selectedYear, dp_inst.selectedMonth, dp_inst.selectedDay)),

Data is provided from wrong fields. If you change selectedYear, selectedMonth and selectedDay with currentYear, currentMonth and currentDay, everything works fine. Hope this will be fixed in one of future releases.