@@ -83,10 +70,6 @@ export default {
type: Array,
default: function () { return [] }
},
- showYearNav: {
- type: Boolean,
- default: true
- },
notBefore: {
type: String,
default: ''
@@ -124,7 +107,6 @@ export default {
showPopup (val) {
if (val) {
this.$nextTick(this.displayPopup)
- // this.displayPopup()
}
}
},
@@ -146,9 +128,6 @@ export default {
}
},
methods: {
- selectDate (date) {
-
- },
closePopup () {
this.showPopup = false
},
diff --git a/demo/App.vue b/demo/App.vue
index faf412b..e7aef29 100644
--- a/demo/App.vue
+++ b/demo/App.vue
@@ -2,7 +2,7 @@
default:
-
+
range:
From a018d1f33e24bc200e48f23f00be9dcf364b75ce Mon Sep 17 00:00:00 2001
From: mengxiong10 <15623530290@163.com>
Date: Tue, 22 Aug 2017 14:46:32 +0800
Subject: [PATCH 17/20] fix README.md
---
README.md | 7 +++----
demo/App.vue | 8 ++++----
2 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 5bbace7..2a9aaf8 100644
--- a/README.md
+++ b/README.md
@@ -53,10 +53,9 @@ export default {
| lang | String | zh | Translation (en/zh/es) |
| placeholder | String | | input placeholder text |
| width | String/Number | 210 | input size |
-| disabledDays | Array | [] | Days in YYYY-MM-DD format to disable |
-| showYearNav | Boolean | true | Show the year nav in the calendar |
-| notBefore | String | '' | Disable all dates before date in YYY-MM-DD format |
-| notAfter | String | '' | Disable all dates after date in YYY-MM-DD format |
+| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable |
+| not-before | String | '' | Disable all dates before date in YYY-MM-DD format |
+| not-after | String | '' | Disable all dates after date in YYY-MM-DD format |
| shortcuts | Boolean/Array | true | the shortcuts for the range picker |
## shortcuts
diff --git a/demo/App.vue b/demo/App.vue
index e7aef29..6458d16 100644
--- a/demo/App.vue
+++ b/demo/App.vue
@@ -6,7 +6,7 @@
range:
-
+
@@ -19,9 +19,9 @@ export default {
components: { DatePicker },
data () {
return {
- value1: '2017-5-9',
- disabledDays: ['2017-8-13'],
- notAfter: '2017-9-16',
+ value1: '2017-6-15',
+ disabledDays: ['2017-6-13'],
+ notAfter: '2017-6-16',
value2: ''
}
}
From b4b69cad4ead5bd04a4a0d8fd625793487ad175c Mon Sep 17 00:00:00 2001
From: mengxiong10 <15623530290@163.com>
Date: Tue, 22 Aug 2017 14:47:10 +0800
Subject: [PATCH 18/20] 1.4.1
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 1dcfe4a..d89374e 100644
--- a/package.json
+++ b/package.json
@@ -2,7 +2,7 @@
"name": "vue2-datepicker",
"description": "A Datepicker Component For Vue2",
"main": "datepicker/index.vue",
- "version": "1.4.0",
+ "version": "1.4.1",
"scripts": {
"dev": "cross-env NODE_ENV=development webpack-dev-server --open --hot",
"build": "cross-env NODE_ENV=production webpack --progress --hide-modules"
From c260270a3dcf97c68ba875a3335f431af13f374c Mon Sep 17 00:00:00 2001
From: mxie <15623530290@163.com>
Date: Wed, 13 Sep 2017 13:16:20 +0800
Subject: [PATCH 19/20] =?UTF-8?q?=E6=B7=BB=E5=8A=A0first-day-of-week=20?=
=?UTF-8?q?=E5=8F=82=E6=95=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
README.md | 25 +++++++++++++------------
datepicker/calendar-panel.vue | 10 +++++++---
datepicker/index.vue | 7 ++++++-
demo/App.vue | 7 +++----
4 files changed, 29 insertions(+), 20 deletions(-)
diff --git a/README.md b/README.md
index 2a9aaf8..2d1b7cd 100644
--- a/README.md
+++ b/README.md
@@ -39,24 +39,25 @@ export default {
-
+
```
## Attributes
-| Prop | Type | Default | Description |
-|-----------------|---------------|-------------|---------------------------------------------------|
-| range | Boolean | false | if true, the type is daterange |
-| format | String | yyyy-MM-dd | Date formatting string |
-| lang | String | zh | Translation (en/zh/es) |
-| placeholder | String | | input placeholder text |
-| width | String/Number | 210 | input size |
-| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable |
-| not-before | String | '' | Disable all dates before date in YYY-MM-DD format |
-| not-after | String | '' | Disable all dates after date in YYY-MM-DD format |
-| shortcuts | Boolean/Array | true | the shortcuts for the range picker |
+| Prop | Type | Default | Description |
+|-------------------|---------------|-------------|---------------------------------------------------|
+| range | Boolean | false | if true, the type is daterange |
+| format | String | yyyy-MM-dd | Date formatting string |
+| lang | String | zh | Translation (en/zh/es) |
+| placeholder | String | | input placeholder text |
+| width | String/Number | 210 | input size |
+| disabled-days | Array | [] | Days in YYYY-MM-DD format to disable |
+| not-before | String | '' | Disable all dates before date in YYY-MM-DD format |
+| not-after | String | '' | Disable all dates after date in YYY-MM-DD format |
+| shortcuts | Boolean/Array | true | the shortcuts for the range picker |
+| first-day-of-week | Number | 7 | set the first day of week (1-7) |
## shortcuts
* true - show the default shortcuts
diff --git a/datepicker/calendar-panel.vue b/datepicker/calendar-panel.vue
index 68ac86f..e3df7cd 100644
--- a/datepicker/calendar-panel.vue
+++ b/datepicker/calendar-panel.vue
@@ -42,7 +42,6 @@ export default {
data () {
const translation = this.$parent.translation
return {
- days: translation.days,
months: translation.months,
dates: [],
now: new Date(), // calendar-header 显示的时间, 用于切换日历
@@ -51,6 +50,11 @@ export default {
}
},
computed: {
+ days () {
+ const days = this.$parent.translation.days
+ const firstday = +this.$parent.firstDayOfWeek
+ return days.concat(days).slice(firstday, firstday + 7)
+ },
currentYear () {
return this.now.getFullYear()
},
@@ -94,9 +98,10 @@ export default {
}
})
}
+ const firstDayOfWeek = this.$parent.firstDayOfWeek
const time = new Date(this.now)
time.setDate(0) // 把时间切换到上个月最后一天
- const lastMonthLength = time.getDay() + 1 // time.getDay() 0是星期天, 1是星期一 ...
+ const lastMonthLength = (time.getDay() + 7 - firstDayOfWeek) % 7 + 1 // time.getDay() 0是星期天, 1是星期一 ...
const lastMonthfirst = time.getDate() - (lastMonthLength - 1)
const lastMonth = getCalendar(time, lastMonthfirst, lastMonthLength, 'lastMonth')
@@ -214,7 +219,6 @@ export default {
}
}
}
-