-
Notifications
You must be signed in to change notification settings - Fork 108
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
Getting the clicked day #67
Comments
Aruan, you will find this code in the monthly.js file:
$(document.body).on("click touchstart", parent + " .monthly-day", function (event) {
// If events, show events list
var whichDay = $(this).data("number");
...
whichDay then holds the day of the month. Is that what you're looking
for?
…On Tue, Jun 27, 2017 at 03:18:37PM -0700, Aruan Cuenca Carrara wrote:
Is there a way to do it and if so, how do I get the value of the day the user clicked?
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#67
|
Yes, I got the day, but if I try to get this value out of that method, I can't get the same result. The original function, that prints the correct day. And the function I'm trying to create, that get "undefined" |
Oh, then I'm not sure. If you send me the whole monthly.js, I could see if I can figure it out, but I'm not an expert. 😄 |
Yeah, I'm a beginner, so anything I can learn from you is profit. Btw, here's my monthly.js (function ($) {
}(jQuery)); |
I'm not sure. I didn't have much luck getting the number out, but you can find the date in the hierarchy output in the javascript console from adding this line in your function:
If you have selected the 8th day of the month, for example, you will find:
somewhere down in the hierarchy, and I think you could extract it. That's all I was able to figure out. |
I think I figured out the problem. The element I'm selecting is "monthly-event-list", which (I believe) has no access to "number", that is an attribute from "monthly-day". Maybe that's the reason I get the "undefined", and I'll try to find a way to get the number from another way. |
Got this working this way: |
Excellent. 👍 |
Thank you for the help! |
Is there a way to do it and if so, how do I get the value of the day the user clicked?
The text was updated successfully, but these errors were encountered: