Skip to content

Commit f0aa284

Browse files
committed
feat: implement refreshAll
1 parent 9bf1806 commit f0aa284

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

src/main/java/com/flowingcode/addons/ycalendar/ExtendedDatePicker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
* Licensed under the Apache License, Version 2.0 (the "License");
88
* you may not use this file except in compliance with the License.
99
* You may obtain a copy of the License at
10-
*
10+
*
1111
* http://www.apache.org/licenses/LICENSE-2.0
12-
*
12+
*
1313
* Unless required by applicable law or agreed to in writing, software
1414
* distributed under the License is distributed on an "AS IS" BASIS,
1515
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -70,7 +70,7 @@ public void setClassNameGenerator(ValueProvider<LocalDate, String> classNameGene
7070

7171
/** Refresh the styles of all dates in the displayed year and month. */
7272
public void refreshAll() {
73-
// getElement().executeJs("setTimeout(()=>this._clearEmptyDaysStyle())");
73+
getElement().executeJs("this.refreshAll()");
7474
}
7575

7676
@ClientCallable

src/main/resources/META-INF/frontend/fc-date-picker/fc-date-picker.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,13 @@ export class FcDatePicker extends DatePicker {
7171
};
7272
}
7373

74+
refreshAll() {
75+
this._styles = {};
76+
if (this._overlayContent) {
77+
this._overlayContent._monthScroller.querySelectorAll("vaadin-month-calendar").forEach(calendar=>this._updateMonthStyles(calendar));
78+
}
79+
}
80+
7481
_updateMonthStyles(element) {
7582

7683
const _clearStyles = function() {

0 commit comments

Comments
 (0)