diff --git a/src/components/DateInput.vue b/src/components/DateInput.vue
index 8803b493..aa334bdd 100644
--- a/src/components/DateInput.vue
+++ b/src/components/DateInput.vue
@@ -2,8 +2,11 @@
-
-
{{ dayCellContent(day) }}
-
+
diff --git a/src/components/PickerHeader.vue b/src/components/PickerHeader.vue
index 4253abf6..34d290be 100644
--- a/src/components/PickerHeader.vue
+++ b/src/components/PickerHeader.vue
@@ -1,24 +1,26 @@
@@ -37,6 +39,10 @@ export default {
}
},
},
+ controlLabel: {
+ type: String,
+ default: null,
+ },
next: {
type: Function,
required: true,
diff --git a/src/components/PickerMonth.vue b/src/components/PickerMonth.vue
index 8a6e3922..f4be2906 100644
--- a/src/components/PickerMonth.vue
+++ b/src/components/PickerMonth.vue
@@ -5,6 +5,7 @@
:config="headerConfig"
:next="nextYear"
:previous="previousYear"
+ control-label="year"
>
-
{{ month.month }}
-
+
diff --git a/src/components/PickerYear.vue b/src/components/PickerYear.vue
index 108d6627..cbaf1fcd 100644
--- a/src/components/PickerYear.vue
+++ b/src/components/PickerYear.vue
@@ -5,6 +5,7 @@
:config="headerConfig"
:next="nextDecade"
:previous="previousDecade"
+ control-label="decade"
>
{{ pageTitleYear }}
@@ -13,15 +14,16 @@
-
{{ year.year }}
-
+
diff --git a/src/mixins/pickerMixin.vue b/src/mixins/pickerMixin.vue
index fe14bcc9..e55437ce 100644
--- a/src/mixins/pickerMixin.vue
+++ b/src/mixins/pickerMixin.vue
@@ -17,6 +17,10 @@ export default {
return {}
},
},
+ format: {
+ type: [String, Function],
+ default: 'dd MMM yyyy',
+ },
isRtl: {
type: Boolean,
default: false,
@@ -79,6 +83,15 @@ export default {
},
},
methods: {
+ formatDate(date) {
+ return typeof this.format === 'function'
+ ? this.format(new Date(date.timestamp))
+ : this.utils.formatDate(
+ new Date(date.timestamp),
+ this.format,
+ this.translation,
+ )
+ },
/**
* Emit an event to show the month picker
*/
diff --git a/src/styles/mixins.scss b/src/styles/mixins.scss
new file mode 100644
index 00000000..97b42caa
--- /dev/null
+++ b/src/styles/mixins.scss
@@ -0,0 +1,22 @@
+@mixin button-reset {
+ background: transparent;
+ border: none;
+ margin: 0;
+ overflow: visible;
+ padding: 0;
+ width: auto;
+
+ /* Inherit font & color from ancestor */
+ color: inherit;
+ font: inherit;
+
+ /* Normalize `line-height`. Cannot be changed from `normal` in Firefox 4+. */
+ line-height: normal;
+
+ /* Corrects font smoothing for webkit */
+ -webkit-font-smoothing: inherit;
+ -moz-osx-font-smoothing: inherit;
+
+ /* Corrects inability to style clickable `input` types in iOS */
+ -webkit-appearance: none;
+}
\ No newline at end of file
diff --git a/src/styles/style.scss b/src/styles/style.scss
index 54081a69..de0b9049 100755
--- a/src/styles/style.scss
+++ b/src/styles/style.scss
@@ -1,3 +1,5 @@
+@import "mixins";
+
.rtl {
direction: rtl;
}
@@ -44,6 +46,8 @@
.prev,
.next {
+ background: transparent;
+ border: none;
float: left;
max-height: 40px;
position: relative;
@@ -116,6 +120,7 @@
}
.cell {
+ background: transparent;
border: 1px solid transparent;
display: inline-block;
height: 40px;
@@ -196,6 +201,7 @@
.vdp-datepicker__clear-button,
.vdp-datepicker__calendar-button {
+ @include button-reset;
cursor: pointer;
font-style: normal;
diff --git a/test/unit/specs/Datepicker/Datepicker.spec.js b/test/unit/specs/Datepicker/Datepicker.spec.js
index 54a509c5..2caf3804 100755
--- a/test/unit/specs/Datepicker/Datepicker.spec.js
+++ b/test/unit/specs/Datepicker/Datepicker.spec.js
@@ -68,7 +68,7 @@ describe('Datepicker mounted', () => {
calendarButton: true,
})
- const calendarButton = wrapper.find('span.vdp-datepicker__calendar-button')
+ const calendarButton = wrapper.find('.vdp-datepicker__calendar-button')
await calendarButton.trigger('click')
expect(wrapper.vm.isOpen).toBeTruthy()
@@ -83,7 +83,7 @@ describe('Datepicker mounted', () => {
showCalendarOnFocus: true,
})
- const calendarButton = wrapper.find('span.vdp-datepicker__calendar-button')
+ const calendarButton = wrapper.find('.vdp-datepicker__calendar-button')
await calendarButton.trigger('click')
expect(wrapper.vm.isOpen).toBeTruthy()
@@ -99,7 +99,7 @@ describe('Datepicker mounted', () => {
})
const input = wrapper.find('input')
- const calendarButton = wrapper.find('span.vdp-datepicker__calendar-button')
+ const calendarButton = wrapper.find('.vdp-datepicker__calendar-button')
await input.trigger('focus')
expect(wrapper.vm.isOpen).toBeTruthy()