Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialTadjiev Codes
9,626 PointsFetch API Nasa APOD Api date pickers issue
Dear Treehouse folks or Mr.Steven, The new workspace: https://w.trhou.se/8gtrn0olm6 On Github: https://github.com/TadjievCodes/Nasa_Project_Another_Version I added some styling if you could please review if the fetch API works fine or it's better if I used the old style that I learned first. And I can't seem to understand how to connect these two datepickers and get the range of values.
// Second on the right date picker
date_btn.addEventListener('click', function(event) {
let date_val = calendar.value;
let actual_date = new Date(date_val); // convert string to Date Object
// preventing default behaviour
event.preventDefault()
if (actual_date < min_date || actual_date > new Date()) {
console.log("out of range!!")
} else {
getData(date_val).catch(err => {
console.log(err)
});
}
})
But what way would connect these two date pickers so it returns the range of values? I saw a bunch of examples with Jquery Code on StackOverflow but I can't make them work even though I add Jquery script external to connect Jquery. I don't understand jquery at all. Also, it might be the reason.