Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move update functionality to setDate and remove update #575

Open
eternicode opened this issue Aug 2, 2013 · 9 comments
Open

Move update functionality to setDate and remove update #575

eternicode opened this issue Aug 2, 2013 · 9 comments
Projects
Milestone

Comments

@eternicode
Copy link
Contributor

As evidenced by a rash of related bugs (#399, #466, #544, #554, #556), people expect setDate to behave as update does (and, not coincidentally, how jQuery UI datepicker's setDate does) -- despite the documentation clearly stating that setDate "sets the internal date", nothing more.

@omidkrad
Copy link

omidkrad commented Aug 5, 2013

I see no use case where you want to setDate without getting the UI updated.

@jtjeferreira
Copy link

Hi

Would also be nice if setDate could support the jqueryUi signature, namely

"The new date may be a Date object or a string in the current date format (e.g., "01/26/2009"), a number of days from today (e.g., +7) or a string of values and periods ("y" for years, "m" for months, "w" for weeks, "d" for days, e.g., "+1m +7d"), or null to clear the selected date"

I was most interested in the string in the current form, and null parameter

@topa
Copy link

topa commented Sep 27, 2013

I think you should not merge those functions, because otherwise it would be hard to realize some kind of multiple-datepicker.
If you want to realize, e.g. a triple-datepicker, you probably want to display different months, but only one selected or active date. This means if you select in one of those datepickers a date you don't want to update the view of the others pickers, but only their internal date.

@fletchowns
Copy link

http://jsfiddle.net/LT7qE/3/

How come that datepicker popup doesn't have a date selected?

@fletchowns
Copy link

http://jsfiddle.net/LT7qE/7/

Shouldn't update trigger changeDate?

@jimmykarily
Copy link

@fletchowns +1. I think changeDate should be triggered. One should be able to count on changeDate event to do other stuff.

@stephanvierkant
Copy link

I agree that setDate should fire an update as well. After a question on StackOverflow, I found out that even datepicker('update', new Date()) does not update the UI: http://jsfiddle.net/svierkant/9Xek7/7/

@jdbdnz
Copy link

jdbdnz commented Sep 2, 2014

@eternicode I'm just tracing this issue through the github regarding setDate / update not affecting the UI. I accept that the documentation says "setDate" will affect the internal date, but "update" now seems to do nothing at all? This seems in be at odds with your previous message:

"The documentation states that setDate "Sets the internal date." It says nothing about updating the UI etc; update is the right choice for a proper "update" of everything. It was broken somewhere along the way, though, and 95f06bc (will be in 1.2.0) fixes it to properly update the UI as expected. #575 in 2.0.0 will move the update functionality to setDate."

@razvanphp
Copy link

Version 1.4.0

  • update function does not update the UI if you pass a date object (works only with a string)
  • update function never triggers changeDate
  • .datepicker('setDate', new Date()) does not return the object for chaining another datepicker method
  • setDate still does not highlight the current date for the inline version

@Azaret Azaret mentioned this issue Oct 8, 2016
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Release 2.0
refactoring
Development

No branches or pull requests

10 participants