Skip to content

Commit dc65826

Browse files
committed
fix: mode='month' a-date-picker disabledDate prop is invalid
1 parent 958e5e4 commit dc65826

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

components/vc-calendar/src/Calendar.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ const Calendar = {
325325
locale={locale}
326326
mode={sMode}
327327
value={sValue}
328+
disabledMonth={disabledDate}
328329
onValueChange={this.setValue}
329330
onPanelChange={this.onPanelChange}
330331
renderFooter={renderFooter}

examples/App.vue

+13
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,27 @@
3232
{ key: 'tab2', tab: 'tab2' },
3333
]"
3434
/>
35+
<a-date-picker :disabledDate="disabled"></a-date-picker>
36+
<a-date-picker mode="year"></a-date-picker>
37+
<a-date-picker mode="month" :disabledDate="disabledMonth"></a-date-picker>
3538
</div>
3639
</template>
3740
<script>
41+
import moment from 'moment';
42+
3843
export default {
3944
data() {
4045
return {
4146
text: `A dog is a type of domesticated animal. Known for its loyalty and faithfulness, it can be found as a welcome guest in many households across the world.`,
4247
};
4348
},
49+
methods: {
50+
disabled(current) {
51+
return current && current > moment().endOf('day');
52+
},
53+
disabledMonth(current) {
54+
return current && current > moment().endOf('month');
55+
},
56+
},
4457
};
4558
</script>

0 commit comments

Comments
 (0)