pwt.datepicker
pwt.datepicker copied to clipboard
Let developer to change title and alt-title for custom drawing
Hi Many thanks for this awesome component. I want to change title of main day and alt.day. But in your code (persian-datepicker.js v1.2.0) at line 3190 and 3191 this two variables are fixed and could not be changed by developer. I suggest this two lines changed for calling function with default behaviors and let developer to change this two functions.
current:
3190: title: calcedDate.format('D'),
3191: alterCalTitle: new persianDate(calcedDate.valueOf()).toCalendar(anotherCalendar[0]).toLocale(anotherCalendar[1]).format('D'),
new:
3190: title: this.getTitleForDraw(calcedDate),
3191: alterCalTitle: this.getAlterTitleForDraw(calcedDate, anotherCalendar),
and new functions:
...
}, {
key: 'getTitleForDraw',
value: function getTitleForDraw(calcedDate) {
return calcedDate.format('D');
}
}, {
key: 'getAlterTitleForDraw',
value: function getAlterTitleForDraw(calcedDate, anotherCalendar) {
return new persianDate(calcedDate.valueOf()).toCalendar(anotherCalendar[0]).toLocale(anotherCalendar[1]).format('D');
}
...
Thanks