Skip to content

Commit

Permalink
Change the props max default value of date-picker (didi#763)
Browse files Browse the repository at this point in the history
* chore(eslint): fix some eslint bugs

* feat(date-picker): set max default value according to the current time

760
  • Loading branch information
QiuShuiBai authored Mar 9, 2021
1 parent ffcd3c4 commit 73eebac
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion document/common/js/highlight.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import hljs from 'highlight.js/lib/highlight'
import hljs from 'highlight.js/lib/highlight'

import shell from 'highlight.js/lib/languages/shell'
import css from 'highlight.js/lib/languages/css'
Expand Down
4 changes: 2 additions & 2 deletions document/components/docs/en-US/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ __Notice:__ Cause this component used create-api, so you should read [create-api

| Attribute | Description | Type | Accepted Values | Default | Example |
| - | - | - | - | - | - |
| min | the minimum value of optional range | Date, Array | - | new Date(2010, 1, 1) | new Date(2008, 7, 8) |
| max | the maximum value of optional range | Date, Array | - | new Date(2020, 12, 31) | new Date(2020, 9, 20) |
| min | the minimum value of optional range | Date, Array | - | new Date(2010, 0, 1) | new Date(2008, 7, 8) |
| max | the maximum value of optional range | Date, Array | - | December 31 of next year based on current time [new Date().getFullYear() + 1, 12, 31, 23, 59, 59] | new Date(2020, 9, 20) |
| value | current selected Date | Date, Array | - | the minimum value of optional range | new Date() |
| startColumn | the start column | String | year/month/date/hour/minute/second| year | hour |
| columnCount | the count of column | Number | - | 3 | 6 |
Expand Down
4 changes: 2 additions & 2 deletions document/components/docs/zh-CN/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ __注:__ 由于此组件基于 create-api 实现,所以在使用之前,请

| 参数 | 说明 | 类型 | 可选值 | 默认值 | 示例 |
| - | - | - | - | - | - |
| min | 可选范围的最小值 | Date, Array | - | new Date(2010, 1, 1) | new Date(2008, 7, 8) |
| max | 可选范围的最大值 | Date, Array | - | new Date(2020, 12, 31) | new Date(2020, 9, 20) |
| min | 可选范围的最小值 | Date, Array | - | new Date(2010, 0, 1) | new Date(2008, 7, 8) |
| max | 可选范围的最大值 | Date, Array | - | 当前时间未来一年的12月31日,[new Date().getFullYear() + 1, 12, 31, 23, 59, 59] | new Date(2020, 9, 20) |
| value | 当前选择的日期 | Date, Array | - | 可选范围的最小值 | new Date() |
| startColumn | 起始列 | String | year/month/date/hour/minute/second| year | hour |
| columnCount | 列数 | Number | - | 3 | 6 |
Expand Down
2 changes: 1 addition & 1 deletion example/components/json-view.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</template>

<script type="text/ecmascript-6">
import hljs from 'highlight.js/lib/highlight'
import hljs from 'highlight.js/lib/highlight'
import json from 'highlight.js/lib/languages/json'
import 'highlight.js/styles/solarized-dark.css'
hljs.registerLanguage('json', json)
Expand Down
2 changes: 1 addition & 1 deletion src/components/date-picker/date-picker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
max: {
type: [Date, Array],
default() {
return new Date(2020, 11, 31)
return [new Date().getFullYear() + 1, 12, 31, 23, 59, 59]
}
},
startColumn: {
Expand Down

0 comments on commit 73eebac

Please sign in to comment.