now macro with dateFormat filter

"Walter Krivanek, VividVisions" <[email protected]> Fri, 1 Feb 2008 12:14:49 +0100
Newsgroups gmane.comp.java.helma.general
Message-ID <[email protected]>
Hi,

this combination of two core module features doesn't work:
<% now | dateFormat "yyyy" %>

Because dateFormat_filter just handles Date objects but now_macro  
returns a string.
I've update my local copy of dateFormat_filter to create Date objects  
if input is a string.

function dateFormat_filter(input, param, format) {
    var format = param.format || format;
    if (!input) {
       return;
    } else {
       if (typeof input == "string") input = new Date(input);
       return input.format(format);
    }
}

Bye,
Walter

_______________________________________________
Helma-user mailing list
[email protected]
http://helma.org/mailman/listinfo/helma-user
smime.p7s (application/pkcs7-signature, 2.4 KB) - not displayed