@@ -311,6 +310,7 @@ If type is `daterange`, `default-value` sets the left side calendar.
<el-date-picker
v-model="value9"
type="daterange"
align="right"
start-placeholder="Start Date"
end-placeholder="End Date"
default-value="2010-10-01">
...
...
@@ -331,33 +331,21 @@ If type is `daterange`, `default-value` sets the left side calendar.
```
:::
### Default start & end time value
When picking date range on the date panel with type `datetimerange`, `00:00:00` will be used as the default time value for start & end date. We can control it with option `default-time`.
### Default time for start date and end date
`default-time` accepts an array of string. The first item controls time value of the start date and the second item controls time value of the end date.
When picking a date range, you can assign the time part for start date and end date.
:::demo
:::demo By default, the time part of start date and end date are both `00:00:00`. Setting `default-time` can change their time respectively. It accepts an array of up to two strings with the format of `12:00:00`. The first string sets the time for the start date, and the second for the end date.
```html
<template>
<divclass="block">
<spanclass="demonstration">start date time 12:00:00</span>
<p>Component value:{{ value12 }}</p>
<el-date-picker
v-model="value12"
type="datetimerange"
start-placeholder="Start Date"
end-placeholder="End Date"
:default-time="['12:00:00']">
</el-date-picker>
</div>
<divclass="block">
<spanclass="demonstration">start date time 12:00:00, end date time 08:00:00</span>
<el-date-picker
v-model="value13"
type="datetimerange"
start-placeholder="Start Date"
end-placeholder="End Date"
:default-time="['12:00:00', '08:00:00']">
type="daterange"
start-placeholder="Start date"
end-placeholder="End date"
:default-time="['00:00:00', '23:59:59']">
</el-date-picker>
</div>
</template>
...
...
@@ -366,8 +354,7 @@ When picking date range on the date panel with type `datetimerange`, `00:00:00`
exportdefault{
data(){
return{
value12:'',
value13:''
value12:[]
};
}
};
...
...
@@ -440,7 +427,7 @@ This feature is at alpha stage. Feedback welcome.
| default-value | optional, default date of the calendar | Date | anything accepted by `new Date()` | — |
| default-time | optional, the time value to use when select datetime range in date table (type `datetimerange`) | string[] | Array with length 2, each item is a string like `12:00:00`. The first item for the start datetime and then second item for the end datetime | — |
| default-time | optional, the time value to use when selecting date range | string[] | Array with length 2, each item is a string like `12:00:00`. The first item for the start date and then second item for the end date | — |
| value-format | optional, format of binding value. If not specified, the binding value will be a Date object | string | year `yyyy`, month `MM`, day `dd`, hour `HH`, minute `mm`, second `ss`, AM/PM `A` | — |
| name | same as `name` in native input | string | — | — |
| unlink-panels | unlink two date-panels in range-picker | boolean | — | false |
@@ -234,6 +224,47 @@ DateTimePicker is derived from DatePicker and TimePicker. For a more detailed ex
```
:::
### Default time value for start date and end date
:::demo When picking date range on the date panel with type `datetimerange`, `00:00:00` will be used as the default time value for start and end date. We can control it with the `default-time` attribute. `default-time` accepts an array of up to two strings. The first item controls time value of the start date and the second item controls time value of the end date.
```html
<template>
<divclass="block">
<spanclass="demonstration">Start date time 12:00:00</span>
<el-date-picker
v-model="value5"
type="datetimerange"
start-placeholder="Start Date"
end-placeholder="End Date"
:default-time="['12:00:00']">
</el-date-picker>
</div>
<divclass="block">
<spanclass="demonstration">Start date time 12:00:00, end date time 08:00:00</span>
| default-value | optional, default date of the calendar | Date | anything accepted by `new Date()` | — |
| default-time | the time value to use when selecting date range | string[] | Array with length 2, each item is a string like `12:00:00`. The first item for the start date and then second item for the end date | — |
| value-format | optional, format of binding value. If not specified, the binding value will be a Date object | string | year `yyyy`, month `MM`, day `dd`, hour `HH`, minute `mm`, second `ss`, AM/PM `A` | — |
| name | same as `name` in native input | string | — | — |
| unlink-panels | unllink two date-panels in range-picker | boolean | — | false |
@@ -310,6 +311,7 @@ Si el tipo es `daterange`, `default-value` establece el calendario del lado izqu
<el-date-picker
v-model="value9"
type="daterange"
align="right"
start-placeholder="Start Date"
end-placeholder="End Date"
default-value="2010-10-01">
...
...
@@ -330,6 +332,37 @@ Si el tipo es `daterange`, `default-value` establece el calendario del lado izqu
```
:::
### Default time for start date and end date
When picking a date range, you can assign the time part for start date and end date.
:::demo By default, the time part of start date and end date are both `00:00:00`. Setting `default-time` can change their time respectively. It accepts an array of up to two strings with the format of `12:00:00`. The first string sets the time for the start date, and the second for the end date.
```html
<template>
<divclass="block">
<p>Component value:{{ value12 }}</p>
<el-date-picker
v-model="value12"
type="daterange"
start-placeholder="Start date"
end-placeholder="End date"
:default-time="['00:00:00', '23:59:59']">
</el-date-picker>
</div>
</template>
<script>
exportdefault{
data(){
return{
value12:[]
};
}
};
</script>
```
:::
### Formato del valor
De forma predeterminada, DatePicker emite el objet `Date`. Puede utilizar `value-format` para designar el formato del valor emitido, acepta la misma cadena de formato del atributo `format`.
...
...
@@ -395,6 +428,7 @@ Esta característica está en la etapa alfa. Feedback bienvenido.
| picker-options | opciones adicionales, chequee la tabla debajo | object | — | {} |
| default-value | opcional, valor por defecto para el calendario | Date | cualquiera aceptado por `new Date()` | — |
| default-time | optional, the time value to use when selecting date range | string[] | Array with length 2, each item is a string like `12:00:00`. The first item for the start date and then second item for the end date | — |
| value-format | opcional, formato del valor enlazado. Si no esta especificado, el valor enlazado será un objeto Date. | string | año `yyyy`, mes `MM`, dia `dd`, hora `HH`, minuto `mm`, segundo `ss` | — |
| name | igual que `name` en el input nativo | string | — | — |
| unlink-panels | desvincular los dos paneles de fecha en el range-picker | boolean | — | false |
@@ -235,6 +225,47 @@ DateTimePicker se deriva de DatePicker y TimePicker. Por una explicación más d
```
:::
### Default time value for start date and end date
:::demo When picking date range on the date panel with type `datetimerange`, `00:00:00` will be used as the default time value for start and end date. We can control it with the `default-time` attribute. `default-time` accepts an array of up to two strings. The first item controls time value of the start date and the second item controls time value of the end date.
```html
<template>
<divclass="block">
<spanclass="demonstration">Start date time 12:00:00</span>
<el-date-picker
v-model="value5"
type="datetimerange"
start-placeholder="Start Date"
end-placeholder="End Date"
:default-time="['12:00:00']">
</el-date-picker>
</div>
<divclass="block">
<spanclass="demonstration">Start date time 12:00:00, end date time 08:00:00</span>
<el-date-picker
v-model="value6"
type="datetimerange"
align="right"
start-placeholder="Start Date"
end-placeholder="End Date"
:default-time="['12:00:00', '08:00:00']">
</el-date-picker>
</div>
</template>
<script>
exportdefault{
data(){
return{
value5:'',
value6:''
};
}
};
</script>
```
:::
### Atributos
| Atributos | Descripción | Tipo | Valores aceptados | Por defecto |
@@ -254,6 +285,7 @@ DateTimePicker se deriva de DatePicker y TimePicker. Por una explicación más d
| picker-options | opciones adicionales, Comprueba la tabla de mas abajo | object | — | {} |
| range-separator | separador de rango | string | - | '-' |
| default-value | opcional, fecha predeterminada del calendario | Fecha | cualquier cosa aceptada por `new Date()` — | |
| default-time | the time value to use when selecting date range | string[] | Array with length 2, each item is a string like `12:00:00`. The first item for the start date and then second item for the end date | — |
| value-format | opcional, formato de valor de enlazado. Si no se especifica, el valor de enlazado será un objeto Date | cadena | año `yyyy`, mes `MM`, día `dd`, hora `HH`, minuto `mm`, segundo `ss` | — |
| name | igual que `name` en la entrada nativa | string | — | — |
| unlink-panels | desconectar dos date-panels en range-picker | boolean | — | false |