[exslt] RE: date.msxsl.xsl
by Bruce Krautbauer other posts by this author
Mar 21 2002 3:24PM messages near this date
[exslt] problem with durations with negative time values in date:add
template
|
[exslt] RE: date.msxsl.xsl
Hi Bruce, thanks for the heads-up on those problems you found! I had also found some bugs a
few months ago and sent them to Chris, who had me forward them to Jeni. In retrospect I pr
obably should have reported them to this list, so here is the first one...
Hi Chris,
First, thank you (and the rest of the crew) for all of the great work you are doing on EXSLT
!
I found a minor bug in _validDuration. The code that is checking for 'T' with no hours, min
utes or seconds is not including hours in the check so a duration such as 'PT1H' fails to va
lidate. The fixed function is included below.
I could not find a place on http://www.exslt.org to submit bug reports. Am I missing someth
ing?
Again, thanks for all of your efforts!
Best regards,
Bruce Krautbauer
<code>
function _validDuration(d){
var parts;
var re = new RegExp("^([\-])?P(([0-9]+)Y)?(([0-9]+)M)?(([0-9]+)D)?((T)?(([0-9]+)H)?(([0-9]+
)M)?((([0-9]+)(\.([0-9]+))?)S)?)?$");
if (parts = re.exec(d)){
if ((/T$/.exec(d)) || (parts[9] == "T" && parts[11]+parts[13]+parts[16]+parts[18]== ""))//
~(:+(|) duh!!!
return Number.NaN;
return new Duration(parts[1], parts[3], parts[5], parts[7], parts[11], parts[13], parts[16
], parts[18]);
}
return Number.NaN;
}
</code>
_______________________________________________
exslt mailing list
list@[...].org
http://www.exslt.org/list
|