-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
Hide year navigation from datepicker #219
Comments
You can use the <date-picker @panel-change="handlePanelChange" v-model="value" lang="en" ></date-picker> handlePanelChange (panel, oldPanel) {
if (panel === 'DATE') {
document.querySelector('.mx-icon-last-year').style.display = 'none'
document.querySelector('.mx-icon-next-year').style.display = 'none'
} else if (panel !== 'TIME') {
document.querySelector('.mx-icon-last-year').style.display = 'block'
document.querySelector('.mx-icon-next-year').style.display = 'block'
}
} |
This solution doesn't work if there are various datepicker elements. |
Would be easier, even for CSS styling, if the component would add an attribute or class to the parent element mx-calendar indicating the different modes; date, year, month, time. |
Yes, add class will be better. <date-picker id="datepicker" @panel-change="handlePanelChange" v-model="value" lang="en" ></date-picker> handlePanelChange (panel, oldPanel) {
const datepicker = document.getElementById('datepicker');
if (panel === 'DATE') {
datepicker.querySelector('.mx-icon-last-year').style.display = 'none'
datepicker.querySelector('.mx-icon-next-year').style.display = 'none'
} else if (panel !== 'TIME') {
datepicker.querySelector('.mx-icon-last-year').style.display = 'block'
datepicker.querySelector('.mx-icon-next-year').style.display = 'block'
}
} |
Any hope we can see mode classes anytime soon? Btw, another good thing for styling would be allow to specify a class to the confirmation button, so you can take approach of your own button classes (very common; like btn-primary, and so) instead of repeat styles. |
v2.7.0 .mx-calendar-panel-date .mx-icon-last-year,
.mx-calendar-panel-date .mx-icon-next-year {
display: none;
} |
@doctorsirius <date-picker>
<template slot="footer" slot-scope="{ confirm }>
<button type="button"
class="btn-primary"
@click="confirm">OK</button>
</template>
</date-picker> |
Cool! Thanks! |
Thanks, @mengxiong10 |
@FPTSonPM3 .mx-calendar-panel-year .mx-icon-double-right::before,
.mx-calendar-panel-year .mx-icon-double-left::before {
display: none;
} |
I'm trying css for the header, is there any way to customize the number for the switch to the previous month, the switch to the next month? |
@ghost |
Hi!
How can I hide the year navigation arrows from datepicker, but not in year and moth pickers?
Remove from here:
But not from here:
Thanks!
The text was updated successfully, but these errors were encountered: