Skip to content

added locale option for moment #98

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ export default {

option: {
type: 'day',
locale: 'en',
week: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
format: 'YYYY-MM-DD',
Expand Down Expand Up @@ -123,7 +124,7 @@ export default {

# API

- Option
- Option

* type

Expand All @@ -136,6 +137,12 @@ export default {

```
format: 'YYYY-MM-DD HH:mm'
```

* locale

```
locale: 'en'
```

* placeholder
Expand Down Expand Up @@ -228,7 +235,7 @@ limit: {

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

```
Expand Down Expand Up @@ -267,4 +274,3 @@ date: {
# License

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-datepicker",
"version": "1.3.0",
"version": "1.3.1",
"description": "calendar and datepicker component with material design for Vue.js ",
"main": "vue-datepicker.vue",
"scripts": {
Expand Down Expand Up @@ -40,4 +40,4 @@
]
]
}
}
}
6 changes: 5 additions & 1 deletion vue-datepicker-1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,7 @@ exports.default = {
return {
type: 'day',
SundayFirst: false,
locale: 'en',
week: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
format: 'YYYY-MM-DD',
Expand Down Expand Up @@ -882,6 +883,9 @@ exports.default = {
document.querySelector('.min-box').scrollTop = (document.querySelector('.min-item.active').offsetTop || 0) - 250;
});
}
},
created: function created() {
(0, _moment2.default).locale(this.option.locale);
}
};
</script>
</script>
4 changes: 4 additions & 0 deletions vue-datepicker-es6.vue
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,7 @@ export default {
return {
type: 'day',
SundayFirst: false,
locale: 'en',
week: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
format: 'YYYY-MM-DD',
Expand Down Expand Up @@ -762,6 +763,9 @@ export default {
document.querySelector('.min-box').scrollTop = (document.querySelector('.min-item.active').offsetTop || 0) - 250
})
}
},
created() {
moment.locale(this.option.locale);
}
}
</script>
4 changes: 4 additions & 0 deletions vue-datepicker.es6-1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -438,6 +438,7 @@ export default {
return {
type: 'day',
SundayFirst: false,
locale: 'en',
week: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
format: 'YYYY-MM-DD',
Expand Down Expand Up @@ -815,6 +816,9 @@ export default {
document.querySelector('.min-box').scrollTop = (document.querySelector('.min-item.active').offsetTop || 0) - 250
})
}
},
created() {
moment.locale(this.option.locale);
}
}
</script>
4 changes: 4 additions & 0 deletions vue-datepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,7 @@ exports.default = {
return {
type: 'day',
SundayFirst: false,
locale: 'en',
week: ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su'],
month: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
format: 'YYYY-MM-DD',
Expand Down Expand Up @@ -825,6 +826,9 @@ exports.default = {
document.querySelector('.min-box').scrollTop = (document.querySelector('.min-item.active').offsetTop || 0) - 250;
});
}
},
created: function created() {
(0, _moment2.default).locale(this.option.locale);
}
};
</script>