0

In a view panel, I have one col that is displayed as HTML because I am pointing to documents created with a traditional form. So, I can't set the "Display type" to anything except a String. I've tried to convert the value by using toJavaDate, but that didn't work.

Here is the formula for my HTML column where rowData is the var or view panel. myserver/folder/myapp.nsf part I changed so that I could paste it here...

if (!rowData.isCategory())
var disp = rowData.getColumnValue("PayPeriod");
"<a href='https://myserver/folder/myapp.nsf/0/"+rowData.getUniversalID()+"?OpenDocument'>"
+disp+"</a>"

The link works properly in my view, but the value displayed shows a full date & time value (6/15/13 8:51 AM). All I am trying to do is display it as 06/15/2013 (MM/DD/YYYY)

4

1 回答 1

1

if the column is set to date you could use this to get the correct date format

  if (!rowData.isCategory())
     var formatter
    if(viewScope.formatter){ 
      formatter=viewScope.formatter
    }else{
     formatter = new java.text.SimpleDateFormat( "MM/dd/yyyy" );
      viewScope.formatter=formatter     
    }

    var d = rowData.getColumnValue("PayPeriod");
    var disp=formatter.format(d)
    "<a href='https://myserver/folder/myapp.nsf/0/"+rowData.getUniversalID()+"?OpenDocument'>"
    +disp+"</a>"
于 2013-10-25T13:26:08.863 回答