2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-11 13:12:26 +03:00

添加range-separator

This commit is contained in:
mxie
2018-04-17 14:25:00 +08:00
parent 4e77d374ac
commit a531c988ee
2 changed files with 10 additions and 4 deletions
+5 -3
View File
@@ -52,9 +52,11 @@ export default {
|---------------------|---------------|-------------|-----------------------------------------------------|
| type | String | 'date' | select datepicker or datetimepicker(date/datetime) |
| range | Boolean | false | if true, the type is daterange or datetimerange |
| confirm | Boolean | false | if true, need click the button to change the value |
| format | String | yyyy-MM-dd | Date formatting string |
| lang | String/Object | zh | Translation (en/zh/es/pt-br/fr/ru/de/it/cs)(custom) |
| confirm | Boolean | false | if true, need click the button to change the value |
| disabled | Boolean | false | Disable the component |
| editable | Boolean | false | if true, user can type it(only the range is false) |
| placeholder | String | | input placeholder text |
| width | String/Number | 210 | input size |
| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable |
@@ -66,8 +68,8 @@ export default {
| first-day-of-week | Number | 7 | set the first day of week (1-7) |
| input-class | String | 'mx-input' | the input class name |
| confirm-text | String | 'OK' | the default text to display on confirm button |
| disabled | Boolean | false | Disable the component |
| editable | Boolean | false | if true, user can type it(only the range is false) |
| range-separator | String | '~' | the range separator text |
#### lang
* String (en/zh/es/pt-br/fr/ru/de/it/cs)
+5 -1
View File
@@ -144,6 +144,10 @@ export default {
editable: {
type: Boolean,
default: false
},
rangeSeparator: {
type: String,
default: '~'
}
},
data () {
@@ -198,7 +202,7 @@ export default {
}
if (this.range && this.isValidRange(this.value)) {
return (
this.stringify(this.value[0]) + ' ~ ' + this.stringify(this.value[1])
this.stringify(this.value[0]) + ` ${this.rangeSeparator} ` + this.stringify(this.value[1])
)
}
return ''