datetime - xpages Date Compare -
hi want write style ssjs plan view. set on column date variable "01.06.2007" , if document start date + duration contains 01.06.2007 result background color change.
dateconverter.stringtodate = java.util.date tommy valand code. (http://dontpanic82.blogspot.com.tr/2010/04/xpages-code-snippet-for-datestring.html)
//------------------------------------------------- col = 0;
var zerodate = dateconverter.stringtodate( '01.06.2007', 'dd.mm.yyyy' ) coldate = @adjust(zerodate, 0, 0, col, 0, 0, 0); duration = parseint(rowdata.getcolumnvalue("duration")); startdate = rowdata.getcolumnvalue("start date"); enddate = @adjust(startdate, 0, 0, (duration-1), 0, 0, 0); if(startdate == coldate){ "startcolor"}else if(startdate < coldate && (coldate < enddate)){ "percolor"}else{ "bgcolor"}`
you cannot compare date values < or > afaik. transform notesdatetime stuff java date objects , use before() , after() methods. like
var startdate:notesdatetime = ... ; if(startdate.tojavadate().before(coldate.tojavadate()) && ... ){ ... }
Comments
Post a Comment