@@ -0,0 +1,1704 @@
+package org.commcare.engine.extensions;%0A%0Aimport android.content.Context;%0A%0Aimport org.commcare.dalvik.R;%0Aimport org.commcare.utils.EthiopianDateHelper;%0Aimport org.commcare.utils.NepaliDateUtilities;%0Aimport org.javarosa.core.model.condition.EvaluationContext;%0Aimport org.javarosa.core.model.condition.IFunctionHandler;%0Aimport org.javarosa.xpath.XPathUnsupportedException;%0Aimport org.javarosa.xpath.expr.XPathFuncExpr;%0A%0Aimport java.util.Date;%0Aimport java.util.Vector;%0A%0A/**%0A * @author ctsims%0A */%0Apublic class CalendaredDateFormatHandler implements IFunctionHandler %7B%0A%0A    private final Context context;%0A%0A    public CalendaredDateFormatHandler(Context context) %7B%0A        this.context = context;%0A    %7D%0A%0A    @Override%0A    public String getName() %7B%0A        return %22format-date-for-calendar%22;%0A    %7D%0A%0A    @Override%0A    public Vector getPrototypes() %7B%0A        Vector v = new Vector();%0A        v.add(new Class%5B%5D%7BDate.class, String.class%7D);%0A        return v;%0A    %7D%0A%0A    @Override%0A    public boolean rawArgs() %7B%0A        return false;%0A    %7D%0A%0A    @Override%0A    public Object eval(Object%5B%5D args, EvaluationContext ec) %7B%0A        if (%22%22.equals(args%5B0%5D)) %7B%0A            return %22%22;%0A        %7D%0A        Date d = (Date)XPathFuncExpr.toDate(args%5B0%5D);%0A        String calendar = (String)args%5B1%5D;%0A        if (%22ethiopian%22.equals(calendar)) %7B%0A            return EthiopianDateHelper.ConvertToEthiopian(context, d);%0A        %7D else if (%22nepali%22.equals(calendar)) %7B%0A            return NepaliDateUtilities.convertToNepaliString(%0A                    context.getResources().getStringArray(R.array.nepali_months), d);%0A        %7D else %7B%0A            throw new XPathUnsupportedException(%22Unsupported calendar type: %22 + calendar);%0A        %7D%0A    %7D%0A%7D%0A

Revert "remove now uneeded calendar format handler"