Skip to content
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

Popup message #20

Open
tnanhkhoa opened this issue May 5, 2020 · 4 comments
Open

Popup message #20

tnanhkhoa opened this issue May 5, 2020 · 4 comments
Labels
question Further information is requested

Comments

@tnanhkhoa
Copy link

Hello. How to show a popup message when I click one date?
Thanks.

@DRocksCoding
Copy link

Like what? I don't think this is related to the module itself.

Can you explain in detail what you want to achieve ?

@tnanhkhoa
Copy link
Author

Sorry for misunderstanding. I mean in the inline style, when I click any date, it shows a posts popup of that date

@mymth mymth added the question Further information is requested label May 11, 2020
@mymth
Copy link
Owner

mymth commented May 11, 2020

Doesn't using changeDate event listener work?

If what you want is simply to capture a click on a day regardless of the datepicker's state, you might be able to do something like this.

window.showMessage = (dateStr) => {
  alert(`Clicked date is ${dateStr}`);
};

const datepicker = new Datepicker(elem, {
  beforeShowDay: (date) => ({
    content: `<span onclick="showMessage('${date.toDateString()}')">${date.getDate()}</span>`,
  }),
});

@woxman
Copy link

woxman commented Jul 16, 2022

beforeShowDay: (date) => ({
    content: `<span onclick="showMessage('${date.toDateString()}')">${date.getDate()}</span>`,
  }),

how i can listen onclick date and get data???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants