Guest User

Guest User

  • Tech Writer
  • 2.1k
  • 470k

How to make your date picker reads data on Jquery?

Jan 8 2020 4:28 AM
Hi Team
 
I have date picker from startdate and enddate, i want now my datepicker wherever the user select any date or day, it must reads from my Jquery. Please help, meaning my Jquery is manually programmed for a year on my thingspeak URL.
 
// date functionality
$(document).ready(function(){
$('.input-daterange').datepicker({
dateFormat: "dd-mm-yy",
autoclose:true
});
});
//checking equality for channel fields on thingspeak.
$(function(){
$("#download").click(function(e) {
e.preventDefault();
var isTemperature = ($('#temperature').is(':checked'));
var isButtonState = ($('#button_state').is(':checked'));
if(isTemperature&&isButtonState) {
window.open('https://api.thingspeak.com/channels/952961/feeds.csv?api_key=FDJCRN71YJM2R0FM&start=2020-01-06T00:00+02&end=2020-01-10T23:59+02:00&timezone=Africa/Johannesburg');
}else {
if(isTemperature){
window.open('https://api.thingspeak.com/channels/952961/fields/1.csv?api_key=FDJCRN71YJM2R0FM&start=2020-01-06T00:00+02&end=2020-01-10T23:59+02:00&timezone=Africa/Johannesburg');
}else{
if(isButtonState){
window.open('https://api.thingspeak.com/channels/952961/fields/8.csv?api_key=FDJCRN71YJM2R0FM&start=2020-01-06T00:00+02&end=2020-01-10T23:59+02:00&timezone=Africa/Johannesburg');
}
}
}
});
});
 

Answers (3)