Skip to content

Commit

Permalink
修改~今天不行~情况下默认日期的问题
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-siki committed Mar 13, 2017
1 parent 1895787 commit f9a2800
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 13 deletions.
11 changes: 8 additions & 3 deletions datepicker-2.vue
Expand Up @@ -167,12 +167,17 @@
},
// 当前日期
curr(){
let {value} = this,
dateObj, year, month, day;
let {value, noToday} = this,
dateObj,
year="0000",
month="00",
day="00";
if (value) {
dateObj = new Date(value);
} else {
} else if(!noToday) {
dateObj = new Date();
}else{
return {year, month, day};
}
year = dateObj.getFullYear();
month = dateObj.getMonth();
Expand Down
11 changes: 8 additions & 3 deletions datepicker.vue
Expand Up @@ -167,12 +167,17 @@
},
// 当前日期
curr(){
let {value} = this,
dateObj, year, month, day;
let {value, noToday} = this,
dateObj,
year="0000",
month="00",
day="00";
if (value) {
dateObj = new Date(value);
} else {
} else if(!noToday) {
dateObj = new Date();
}else{
return {year, month, day};
}
year = dateObj.getFullYear();
month = dateObj.getMonth();
Expand Down
4 changes: 2 additions & 2 deletions example/demo-src.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example2/demo-src.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "vue-datepicker-simple",
"version": "1.5.0",
"version": "1.5.1",
"description": "一款非常简单的基于vue的日期选择插件",
"main": "datepicker.vue",
"scripts": {
Expand Down

0 comments on commit f9a2800

Please sign in to comment.