From e2303b85a452e408578decee51bfc8160eb875fe Mon Sep 17 00:00:00 2001 From: hetech Date: Mon, 24 Jun 2019 15:07:49 +0800 Subject: [PATCH] Calendar: add first-day-of-week attribute (#16047) --- examples/docs/en-US/calendar.md | 9 +++++---- examples/docs/es/calendar.md | 7 ++++--- examples/docs/fr-FR/calendar.md | 9 +++++---- examples/docs/zh-CN/calendar.md | 1 + packages/calendar/src/date-table.vue | 27 ++++++++++++++++----------- packages/calendar/src/main.vue | 12 ++++++++++++ test/unit/specs/calendar.spec.js | 19 +++++++++++++++++++ types/calendar.d.ts | 3 +++ 8 files changed, 65 insertions(+), 22 deletions(-) diff --git a/examples/docs/en-US/calendar.md b/examples/docs/en-US/calendar.md index 55c265b4..e94ff119 100644 --- a/examples/docs/en-US/calendar.md +++ b/examples/docs/en-US/calendar.md @@ -53,10 +53,11 @@ Display date. ::: ### Attributes -| Attribute | Description | Type | Accepted Values | Default | -|-----------------|-------------- |---------- |---------------------- |--------- | -| value / v-model | binding value | Date/string/number | — | — | -| range | time range, including start time and end time. Start time must be Monday, end time must be Sunday, the time span cannot exceed two months | Array | — | — | +| Attribute | Description | Type | Accepted Values | Default | +|-----------------|------------------- |---------- |---------------------- |--------- | +| value / v-model | binding value | Date/string/number | — | — | +| range | time range, including start time and end time. Start time must be Monday, end time must be Sunday, the time span cannot exceed two months | Array | — | — | +| first-day-of-week | fisrt day of week| Number | 1 to 7 | 1 | ### dateCell scoped slot 参数 | Attribute | Description | Type | Accepted Values | Default | diff --git a/examples/docs/es/calendar.md b/examples/docs/es/calendar.md index ce9c419e..d9b1834a 100644 --- a/examples/docs/es/calendar.md +++ b/examples/docs/es/calendar.md @@ -54,10 +54,11 @@ Muestra fechas. ::: ### Atributos -| Atributo | Descripción | Tipo | Valores aceptados | Por defecto | -|-----------------|-------------- |---------- |---------------------- |--------- | -| value / v-model | valor vinculante | Date/string/number | — | — | +| Atributo | Descripción | Tipo | Valores aceptados | Por defecto | +|-----------------|------------------- |---------- |---------------------- |------------ | +| value / v-model | valor vinculante | Date/string/number | — | — | | range | rango de tiempo, incluyendo el tiempo de inicio y el tiempo final. El tiempo de inicio debe ser el lunes, el tiempo final debe ser el domingo, el período no puede exceder los dos meses. | Array | — | — | +| first-day-of-week | fisrt day of week| Number | 1 to 7 | 1 | ### dateCell scoped slot | Atributo | Descripción | Tipo | Valores aceptados | Por defecto | diff --git a/examples/docs/fr-FR/calendar.md b/examples/docs/fr-FR/calendar.md index 3ab9bce4..404c25c1 100644 --- a/examples/docs/fr-FR/calendar.md +++ b/examples/docs/fr-FR/calendar.md @@ -54,10 +54,11 @@ Affiche un calendrier. ### Attributs -| Attribut | Description | Type | Valeurs acceptées | Défaut | -|-----------------|-------------- |---------- |---------------------- |--------- | -| value / v-model | Valeur liée. | Date/string/number | — | — | -| range | Intervalle de dates, début et fin inclus. Le début doit être un lundi et la fin un dimanche, l'intervalle ne pouvant excéder deux mois. | Array | — | — | +| Attribut | Description | Type | Valeurs acceptées | Défaut | +|------------------ |-------------- |---------- |---------------------- |--------- | +| value / v-model | Valeur liée. | Date/string/number | — | — | +| range | Intervalle de dates, début et fin inclus. Le début doit être un lundi et la fin un dimanche, l'intervalle ne pouvant excéder deux mois. | Array | — | — | +| first-day-of-week | fisrt day of week| Number | 1 to 7 | 1 | ### Slot dateCell diff --git a/examples/docs/zh-CN/calendar.md b/examples/docs/zh-CN/calendar.md index 667a3a30..b7b36e9d 100644 --- a/examples/docs/zh-CN/calendar.md +++ b/examples/docs/zh-CN/calendar.md @@ -57,6 +57,7 @@ |-----------------|-------------- |---------- |------------ |-------- | | value / v-model | 绑定值 | Date/string/number | — | — | | range | 时间范围,包括开始时间与结束时间。开始时间必须是周一,结束时间必须是周日,且时间跨度不能超过两个月。 | Array | — | — | +| first-day-of-week | 周起始日 | Number | 1 到 7 | 1 | ### dateCell scoped slot 参数 | 参数 | 说明 | 类型 | 可选值 | 默认值 | diff --git a/packages/calendar/src/date-table.vue b/packages/calendar/src/date-table.vue index e2d2c000..14f1d9c7 100644 --- a/packages/calendar/src/date-table.vue +++ b/packages/calendar/src/date-table.vue @@ -1,8 +1,9 @@