-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Calendar rebase (4) #1371
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
Calendar rebase (4) #1371
Conversation
Change status caching, fix existing value related methods, introduce $.date construction with date object, selected property is null by default, add selected getter
e784ac0
to
f8b2691
Compare
Changed:
|
f8b2691
to
c40c370
Compare
Fixed lint issues. |
Doing some testing of demos and visual tests.
I think that's enough for now. I don't care if any of that gets addressed in this PR or later, as long as it gets addressed eventually. The input suppression is definitely a regression in this PR (works fine in datepicker branch), that may be the one thing to address here. |
"./core", | ||
"./widget", | ||
"./button" | ||
], factory ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing dependency for $.date
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And Globalize, see TODO comment. Afaik this is already covered by @rxaviers PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://github.com/jquery/jquery-ui/pull/1341/files#diff-563a5392a566d1a29a68b1b5a37c4cb6R16 adds Globalize ("globalize", "globalize/date"
) and $.date
("./calendar/date"
).
Hey @jzaefferer, thanks for the feedback.
Broken in Chrome and IE but Firefox works just fine. I will take a look. I will make sure to recheck your comment when I start working on the associated to do list issues. |
c40c370
to
0cfc479
Compare
Removed altField demo and fixed the input suppression in Chrome and IE. |
We should keep |
0cfc479
to
a68d714
Compare
@scottgonzalez I've restored valueAsDate but kept the option method changes. Please take a look. |
// TODO: This assumes focus is on the first grid. For multi pickers, the widget needs | ||
// to maintain the currently focused grid and base queries like this off of it. | ||
$( this.picker ).find( ".ui-state-focus" ).not( ":first" ).removeClass( "ui-state-focus" ); | ||
this.calendarInstance._setOption( "value", this._getParsedValue() ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you using an internal method from another widget? Use the public option()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in all places.
Add calendar widget by copying and renaming datepicker widget files. Remove datepicker functionality, options and methods from Calendar. Remove calendar functionality, options and methods from Datepicker. Adjust tests due to split and changed specification. Remove duplicated demo files and fix some demos. Simplify calendar generation, use CSS instead of inline styles. Fix destroy method. Make use of uniqueId method. Fix focus highlighting when month is changed. Add version property. Add common unit tests. Fix input keyboard handling.
Improve render day cell mechanism.
Remove shortcut for closing the calendar and erasing the date (CTRL+END). Remove unwanted CTRL+HOME shortcut and support for enter key on input.
Several minor code improvements and make suppressExpandOnFocus an internal variable, remove partial button widget usage in header
Add Test if these options are set on the underlying calendar instance
Prevents refresh from being called multiple times.
a68d714
to
2309f4d
Compare
Updated as suggested by Scott. |
@jzaefferer Do you want to go through your list again and make sure everything was either addressed or can wait and is on the todo list? |
I went through my list above and added checkboxes. I think all the regressions are addressed and this PR can land. I've merged the remaining items into the todo list on the wiki. |
$(function() { | ||
$( "#calendar" ).calendar({ | ||
buttons: { | ||
"Today": function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Drop the quotes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
A few minor comments, they can just be addressed in a new commit if you want. I think we're good to merge now. We can do any further cleanup after the merge. |
@scottgonzalez I've cleaned up the demos. Happy merging :-D |
This replaces #1352.