Jump to content

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


HITESH SAHOO

Recommended Posts

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 daychanges(tomorrow) then only my calendar i.e. input field automatically shows next day(Today) but not my datain 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 select1/17/2019 in calendar and seedata 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.

 

HTML

SELECT DATE :   

 

  

 

 

     

JAVASCRIPT

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

function picker1_onSelect(selectedDate,inst){

 

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

//alert(selectedDate);

/*alert(typeof selectedDate);

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

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

selectedDate = res;

alert(selectedDate);*/

//min date constraint based on other picker

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

$("#datePicker2").datepicker("option","minDate",minDate);

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

//alert(userLang);

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

$.datepicker.setDefaults($.datepicker.regional["en-GB"]);

} else {

$.datepicker.setDefaults($.datepicker.regional["en-GB"]);

}

 

//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: 'http://kalender.isetegija.net/Styles/SandBeach/Images/DatePicker.gif',

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();

if(dd

Link to comment
Share on other sites

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.

 

Thanks

 

 

 

 

Link to comment
Share on other sites

  • 2 weeks later...

Hi Sayali, "mydate" would be my span id for input field i.e dt1 from below code .. right  <SPAN id=dt1><SpotfireControl id="de946cdfdac44114bb80f047b4a7f229" /></SPAN>) As I have already used your code my Java script i.e.//update document property after selection

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

 //$("#dt2 input").focus();  So can you please tell me like where to add and what to change  You can find whole code above.  Thanks    

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...