Skip to content

Commit

Permalink
Merge pull request #7 from rei/start-end-selected
Browse files Browse the repository at this point in the history
start & end selected aria labels
  • Loading branch information
sikhote authored Aug 27, 2021
2 parents 3d6e6f6 + 2ce6b5d commit 50bebbc
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/node_modules/**
/client/build/**
/tests/unit/coverage/**
*.vue
*.md
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ This is a VueJs version of the popular AirBnb datepicker. Supports range selecti
<img src="https://raw.githubusercontent.com/MikaelEdebro/vue-airbnb-style-datepicker/master/docs/images/datepicker-tablet.gif" width="1124" alt="Datepicker on tablet">
<img src="https://raw.githubusercontent.com/MikaelEdebro/vue-airbnb-style-datepicker/master/docs/images/datepicker-mobile.gif" width="425" alt="Datepicker on mobile">

## Development
- Requires Node 10
- Run `npm run dev` and visit [http://localhost:5050]()

## Documentation
[Full documentation on GitBooks](https://mikaeledebro.gitbooks.io/vue-airbnb-style-datepicker/)

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vue-airbnb-style-datepicker",
"version": "2.3.0",
"version": "2.3.1",
"description": "A VueJs version of the popular AirBnb datepicker",
"main": "dist/vue-airbnb-style-datepicker.cjs.js",
"module": "dist/vue-airbnb-style-datepicker.es.js",
Expand Down Expand Up @@ -80,4 +80,4 @@
"pre-commit": "pretty-quick --staged"
}
}
}
}
3 changes: 2 additions & 1 deletion poi.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@ module.exports = {
entry: 'dev/index.js',
dist: 'dev/dist',
homepage: '/vue-airbnb-style-datepicker/',
presets: [require('poi-preset-eslint')({ mode: '*' })],
// Disabled due to many existing eslint errors
// presets: [require('poi-preset-eslint')({ mode: '*' })],
}
10 changes: 10 additions & 0 deletions src/components/AirbnbStyleDatepicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,8 @@ export default {
chooseStartDate: date => `Choose ${date} as your start date.`,
chooseEndDate: date => `Choose ${date} as your end date.`,
selectedDate: date => `Selected. ${date}`,
selectedStartDate: date => `Selected ${date} as your start date.`,
selectedEndDate: date => `Selected ${date} as your end date.`,
unavailableDate: date => `Not available. ${date}`,
previousMonth: 'Move backward to switch to the previous month.',
nextMonth: 'Move forward to switch to the next month.',
Expand Down Expand Up @@ -591,7 +593,15 @@ export default {
}
const isSelected = this.isSelected(date)
if (isSelected) {
if (this.isRangeMode) {
if (this.dateOne === this.selectedDate1) {
return this.ariaLabels.selectedStartDate(dateLabel)
} else {
return this.ariaLabels.selectedEndDate(dateLabel)
}
}
return this.ariaLabels.selectedDate(dateLabel)
}
Expand Down

0 comments on commit 50bebbc

Please sign in to comment.