Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default {

# API

- Option
- Option

* type

Expand Down Expand Up @@ -217,11 +217,21 @@ limit: {

limit:{
type: 'weekday',
available: [1, 2, 3, 4, 5]
available: [1, 2, 3, 4, 5]
}

```

- defaultDate

* if you need to set up a default date other than today, you can pass it on with the `default-date` prop

```javascript

defaultDate: '1970-01-01'

```

### prop

* Vue 1.0
Expand All @@ -248,12 +258,11 @@ date: {

```html

<date-picker :date="date" :limit="limit"></date-picker>
<date-picker :date="date" :limit="limit" :default-date="defaultDate"></date-picker>

```


# License

[The MIT License](http://opensource.org/licenses/MIT)

7 changes: 5 additions & 2 deletions vue-datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ exports.default = {
default: function _default() {
return [];
}
},
defaultDate: {
type: String
}
},
data: function data() {
Expand Down Expand Up @@ -503,7 +506,7 @@ exports.default = {
},
showDay: function showDay(time) {
if (time === undefined || !Date.parse(time)) {
this.checked.currentMoment = (0, _moment2.default)();
this.checked.currentMoment = (0, _moment2.default)(this.defaultDate);
} else {
this.checked.currentMoment = (0, _moment2.default)(time, this.option.format);
}
Expand Down Expand Up @@ -826,4 +829,4 @@ exports.default = {
}
}
};
</script>
</script>