You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two issue with the library and I am wondering if there is a way to overwrite a specific function in pickadate?
DatePicker.prototype.nodes.createYearLabel: Instead of using the focusYear, I want to use the current year.
DatePicker.prototype.nodes.createYearLabel: I do not want the number of years to be divided by 2:
createYearLabel = function() {
var focusedYear = viewsetObject.year;
settings.equallySplitYears = false;
settings.useFocusYear = false;
// if user wants to equally split the years, the year number will be divided in half and added to the
// lowest year and to the highest year
if(settings.equallySplitYears) {
numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears / 2 )
} else {
numberYears = settings.selectYears === true ? 5 : ~~( settings.selectYears )
}
// If there are years to select, add a dropdown menu.
if (numberYears) {
// initialize variables
var minYear, maxYear, lowestYear, highestYear;
if(settings.useFocusYear) {
// calendar uses the selected year in the dropdown to calculate new years.
minYear = minLimitObject.year;
maxYear = maxLimitObject.year;
lowestYear = focusedYear - numberYears;
if(settings.equallySplitYears) {
highestYear = focusedYear + numberYears;
}
} else {
// calendar uses todays year to calculate new years
minYear = minLimitObject.year;
maxYear = maxLimitObject.year;
lowestYear = nowObject.year - numberYears;
if(settings.equallySplitYears) {
highestYear = nowObject + numberYears;
}
} ...
I tried to overwrite this prototype function but I am having problems accessing the DatePicker object. Any hint would be appreciated.
Thanks for this awesome library.
The text was updated successfully, but these errors were encountered:
I have two issue with the library and I am wondering if there is a way to overwrite a specific function in pickadate?
I tried to overwrite this prototype function but I am having problems accessing the DatePicker object. Any hint would be appreciated.
Thanks for this awesome library.
The text was updated successfully, but these errors were encountered: