0

How to change the format of date range input component in pentaho cde.i am getting the format 'yyyy-mm-dd' but i need to change into 'dd-M-yy'.i have return a function under post execution section :

function()
{
var date1 = Dashboards.getParameterValue("parfromDate").toString();

var date2 = Dashboards.getParameterValue("partoDate").toString();
//alert(date1)
//alert(date2)

format = $.datepicker.formatDate("dd-M-yy",new Date(date1));

format2 = $.datepicker.formatDate("dd-M-yy",new Date(date2));


document.getElementById('render_SelectDate').value=format:format2;

}

the same function was working perfect in date input component but i m facing problem in date range component can any one suggest me where i m doing wrong ..

4

2 回答 2

0

最后我根据需要解决了我的问题。我还提到了我现在正在使用的脚本:

function f(){
 var date1 = Dashboards.getParameterValue("date_param").toString();

 testdate = $.datepicker.formatDate("d-M-y",new Date(date1));
 //alert(testdate);
 document.getElementById('render_date_picker').value=testdate;

}  
于 2016-01-07T18:04:08.660 回答
0
**This code also work as charm for Date Range Component**
function f(){
   var date1 = Dashboards.getParameterValue("param1_FromDate").toString();
   var date2 = Dashboards.getParameterValue("param2_ToDate").toString();

   testdate = $.datepicker.formatDate("d-M-y",new Date(date1))+">"+ $.datepicker.formatDate("d-M-y",new Date(date2));

   alert(testdate);
   document.getElementById('render_date_range_picker').value=testdate;
}  
于 2016-01-12T05:54:50.667 回答