@@ -0,0 +1,1016 @@
+package com.branegy.populito.functions;%0A%0Aimport java.text.SimpleDateFormat;%0Aimport java.util.Date;%0A%0Aimport com.branegy.populito.Function;%0Aimport com.branegy.populito.formatter.FormattableFunction;%0A%0Apublic class Now extends Function implements FormattableFunction %7B%0A%0A    Date staticDate;%0A    SimpleDateFormat formatter;%0A    boolean useFirstValue;%0A%0A    @Override%0A    public Object nextValue() %7B%0A    %09Date result;%0A    %09if (useFirstValue) %7B%0A    %09%09if (staticDate==null) %7B%0A    %09%09%09staticDate = new Date();%0A    %09%09%7D%0A    %09%09result = staticDate;%0A    %09%7D else %7B%0A    %09%09result = new Date();%0A    %09%7D%0A    %09return result;%0A    %7D%0A%0A    public void setSingleton(String singleton) %7B%0A    %09useFirstValue = singleton.equalsIgnoreCase(%22true%22);%0A    %7D%0A%0A    public void setFormat(Function format) %7B%0A        String pattern = toString(format.nextValue());%0A        formatter = new SimpleDateFormat(pattern);%0A    %7D%0A%0A    @Override%0A    public String formatValue(Object value) %7B%0A        return value==null ? null : formatter.format((Date)value);%0A    %7D%0A%0A%7D%0A

Add Now function