-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
Plugin "Paint" doesn't work #2638
Comments
I solved it like this
But I have one problem. Dates are only drawn if I select a date. I would like this to happen immediately when the calendar is initialized |
@Alexandr120 Can you create an example like that, please? I'm hardly understand your solution.. |
I've fixed my problem with a some sort of crutch. Example |
@Oustinger done!. Lock here if i creted exemple not correctly, you can try use this //example picker const specilDates = { const getDateFormat = (dateTime) => { datetimepicker1.display.paint = (unit, date, classes, element) => { |
@Alexandr120 Thanks. But painting of days starts only after selecting any date. I need to do it with the first render of calendar... |
Hi everyone. The issue here is that the paint function is getting set after the rendering has already happened. This is only an issue with the inline view. You currently have two options.
const painter = (option, tdClasses, tdFactory) => {
// noinspection JSUnusedLocalSymbols
tdClasses.Display.prototype.paint = (
unit,
date,
classes,
element
) => {
debugger;
if (unit === tdFactory.Unit.date) {
if (date.isSame(new tdFactory.DateTime(), unit)) {
classes.push('special-day');
}
}
};
}
tempusDominus.extend(painter); Unfortunately, there's not a good way to get which picker is calling the global extends. @Anzil-Aufait your issue comes from the fact the I know this is not ideal for your situations, but I'm not sure what I can do without making a breaking change. If you have ideas or would like to submit a PR, I'm open to that. Perhaps in v7 there will be a better way to deal with it. |
Prerequisites
Describe the issue
Plugin "Paint" doesn't work if in options setted:
{ display: inline: true }
. Example in the first StackBlitz forkAnd if to add this option by "updateOptions()" after conneting "Paint" it doesn't work too (but in my project it fixes the bug...). Example in the second StackBlitz fork
StackBlitz fork
What operating system(s) are you seeing the problem on?
Windows
What browser(s) are you seeing the problem on?
Opera
What version of are you using? You can find this information from the sample StackBlitz.
6.0.0
What your browser's locale? You can find this information from the sample StackBlitz.
ru-RU
The text was updated successfully, but these errors were encountered: