Skip to content

Commit 911ce3d

Browse files
island205ziyoung
authored andcommitted
Revert "Calendar: first-day-of-week is not supported when using custom ranges (#16235)" (#16353)
1 parent 1bc3e5a commit 911ce3d

File tree

7 files changed

+2
-40
lines changed

7 files changed

+2
-40
lines changed

examples/docs/en-US/calendar.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ Display date.
5252
```
5353
:::
5454

55-
:::tip
56-
The `first-day-of-week` attribute is not supported when using custom ranges.
57-
:::
58-
5955
### Attributes
6056
| Attribute | Description | Type | Accepted Values | Default |
6157
|-----------------|------------------- |---------- |---------------------- |--------- |

examples/docs/es/calendar.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,6 @@ Muestra fechas.
5353
```
5454
:::
5555

56-
:::tip
57-
The `first-day-of-week` attribute is not supported when using custom ranges.
58-
:::
59-
6056
### Atributos
6157
| Atributo | Descripción | Tipo | Valores aceptados | Por defecto |
6258
|-----------------|------------------- |---------- |---------------------- |------------ |

examples/docs/fr-FR/calendar.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@ Affiche un calendrier.
5252
```
5353
:::
5454

55-
:::tip
56-
The `first-day-of-week` attribute is not supported when using custom ranges.
57-
:::
58-
5955
### Attributs
6056

6157
| Attribut | Description | Type | Valeurs acceptées | Défaut |

examples/docs/fr-FR/form.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ Les callback de validations personnalisées doivent être appelées. Un usage pl
394394
prop="email"
395395
label="Email"
396396
:rules="[
397-
{ required: true, message: 'Veuillez entrer l\'adresse e-mail', trigger: 'blur' },
397+
{ required: true, message: 'Veuillez entrer l'adresse e-mail', trigger: 'blur' },
398398
{ type: 'email', message: 'Veuillez entrer une adresse e-mail valide', trigger: ['blur', 'change'] }
399399
]"
400400
>

examples/docs/zh-CN/calendar.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
```
5353
:::
5454

55-
:::tip
56-
使用自定义范围时,不支持 first-day-of-week 属性。
57-
:::
58-
5955
### Attributes
6056
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
6157
|-----------------|-------------- |---------- |------------ |-------- |

packages/calendar/src/date-table.vue

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,7 @@ export default {
141141
},
142142
143143
weekDays() {
144-
let start = this.firstDayOfWeek;
145-
if (this.isInRange) {
146-
start = 1;
147-
}
144+
const start = this.firstDayOfWeek;
148145
if (typeof start !== 'number' || start === 0) {
149146
return WEEK_DAYS.slice();
150147
} else {

test/unit/specs/calendar.spec.js

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,5 @@ describe('Calendar', () => {
8585
expect(firstRow.firstElementChild.innerText).to.be.equal('31');
8686
expect(firstRow.lastElementChild.innerText).to.be.equal('6');
8787
});
88-
89-
it('if range is specified, firstDayOfWeek will be ignored', async() => {
90-
vm = createVue({
91-
template: `
92-
<el-calendar v-model="value" :first-day-of-week="0" :range="['2019-03-04', '2019-03-24']"></el-calendar>
93-
`,
94-
data() {
95-
return {
96-
value: new Date('2019-03-04')
97-
};
98-
}
99-
}, true);
100-
const head = vm.$el.querySelector('.el-calendar-table thead');
101-
expect(head.firstElementChild.innerText).to.be.equal('一');
102-
expect(head.lastElementChild.innerText).to.be.equal('日');
103-
const firstRow = vm.$el.querySelector('.el-calendar-table__row');
104-
expect(firstRow.firstElementChild.innerText).to.be.equal('4');
105-
expect(firstRow.lastElementChild.innerText).to.be.equal('10');
106-
});
10788
});
10889

0 commit comments

Comments
 (0)