Skip to content

Add notes about multiple dates and examples for update method #2060

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

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions docs/methods.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,21 @@ update

Arguments:

* date (String|Date|Array, optional)
* date (String|Date, optional)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Azaret I think that you want to delete this line and leave * date (String|Date|Array, optional).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I wasn't sure how to show the fact that date is *args for string and Date. But not when Array.

* ...

Update the datepicker with given argument or the current input value.

If ``date`` is provided and is a Date object, it is assumed to be a "local" date object, and will be converted to UTC for internal use.
Update the datepicker with given arguments or the current input value.
The arguments can be either an array of strings, an array of Date objects, multiples strings or multiples Date objects.
If ``date`` arguments are provided and they are Date objects, it is assumed to be "local" Date objects, and will be converted to UTC for internal use.

::

$('.datepicker').datepicker('update');
$('.datepicker').datepicker('update', '2011-03-05');
$('.datepicker').datepicker('update', '2011-03-05', '2011-03-07');
$('.datepicker').datepicker('update', new Date(2011, 2, 5));
$('.datepicker').datepicker('update', [new Date(2011, 2, 5), new Date(2011, 2, 7)]);

To reset the datepicker and clear the selected date, pass an empty string with ``update``:

Expand Down