Calendar(input field) changes but not data. Please help

Hi All, 

Here's the secanio, I made a calender (screenshot attached) from JavaScript(code below). By using this calendar's input I am data limting in vizualisation using code [report date] = DateAdd('dd', -1, DocumentProperty("reportDate")  )  which works perfectly fine every time user selects date. But the problem that i am facing is, when day changes(tomorrow) then only my calendar i.e. input field automatically shows next day(Today) but not my data  in my vizualisation that i am limiting with code [report date] = DateAdd('dd', -1, DocumentProperty("reportDate")  ).  

Example : 

Suppose, Today's date is 1/17/2019. So I select 1/17/2019 in calendar and see data in vizualisation of 1/16/2018 as my code is today-1([report date] = DateAdd('dd', -1, DocumentProperty("reportDate")  ).  ) and then saves it.

when next day, date changes to 1/18/2019,so my calendar input field automatically changes to 1/18/2019 which is awesome but not the vizualisation whose data limit condition is  [report date] = DateAdd('dd', -1, DocumentProperty("reportDate")  ) rather it is showing me data of 1/16/2019. 

So is there any way to fix this.

May be R, IronPython or any conditions/logic in calculated columns can help me or if i can give a placeholder in input field as "Please select date" would work for me but remember my input field is Date type so this might not work. Anyway, Please let me know the better solution to overcome this glitch.  



<FONT size=4> <B>SELECT DATE</B> : &nbsp;&nbsp; 

<SPAN id=dt1picker></SPAN>


<SPAN id=dt1><SpotfireControl id="de946cdfdac44114bb80f047b4a7f229" /></SPAN>

<SPAN id=dt1picker></SPAN>

 &nbsp; <SpotfireControl id="e9840dec5d5747eca3ce7c552d7966a4" />&nbsp;&nbsp;&nbsp;


//constraint date2 calendar based on selection and update property controls automatically

function picker1_onSelect(selectedDate,inst){


//console.log('selected ', selectedDate);


/*alert(typeof selectedDate);

var selectedDateArr = selectedDate.split("/");

var res = selectedDateArr[1] + "/" + selectedDateArr[0] + "/" + selectedDateArr[2];

selectedDate = res;


 //min date constraint based on other picker 

 minDate = $(this).datepicker("getDate")


 var userLang = navigator.language || navigator.userLanguage; 


if (userLang == "en-US") {


} else {




 //update document property after selection

 //$("#dt1 input").focus(); 

 //$("#dt2 input").focus(); 


//update document property after selection

function picker2_onSelect(selectedDate){

 $("#dt2 input").focus(); 

 $("#dt1 input").focus(); 


//global datepicker options

pickerOptions = {

 showOn: 'button', 

 buttonImageOnly: true, 

 buttonImage: '', 

 minDate: "-12M", 

 maxDate: "+1D",

 changeMonth: true,

 changeYear: true,

 dateFormat: 'mm/dd/yy'


var today = new Date();

var dd = today.getDate();

var mm = today.getMonth()+1; 

var yyyy = today.getFullYear();








today = mm+'/'+dd+'/'+yyyy;

//create first date picker

/*document.getElementById('dt1picker').innerHTML="<input type='hidden' id='datePicker1' value="+$('#dt1Label').text()+">"


$("#datePicker1").datepicker( "setDate" , "01/01/"+new Date().getFullYear());

$("#datePicker1").datepicker("option",{altField:"#dt1 input", onClose:picker1_onSelect})


//create second date picker

document.getElementById('dt1picker').innerHTML="<input type='hidden' id='datePicker1' value="+$('#dt1Label').text()+">"


$("#datePicker1").datepicker( "setDate" , today);

$("#datePicker1").datepicker("option",{altField:"#dt1 input", onClose:picker2_onSelect})



Thank You




Image icon calendar.jpg7.47 KB


Hi Khushboo, 

Thanks for replying. 

DocumentProperty("reportDate") does not change to next day automatically unless user goes and select today's date in calendar then only it is getting changed. 

So, input field changes automatically to next dat but not doc prop's value, kind of strange.

Please let me know if there's a way.




HS - Jan 18, 2019 - 9:33pm

When it shows next day in input field, did you navigate to Edit > Document Properties> DocumentProperty("reportDate") to see what is actually shows??

Khushboo R - Jan 18, 2019 - 7:15am
+ Add a Comment

(1) Answer