class FieldWriterCalendarFunc<T>
        extends FieldWriterDate<T> {
    final Function<T, Calendar> function;

    FieldWriterCalendarFunc(
            String fieldName,
            int ordinal,
            long features,
            String dateTimeFormat,
            String label,
            Field field,
            Method method,
            Function<T, Calendar> function
    ) {
        super(fieldName, ordinal, features, dateTimeFormat, label, Calendar.class, Calendar.class, field, method);
        this.function = function;
    }

    @Override
    public Object getFieldValue(T object) {
        return function.apply(object);
    }

    @Override
    public void writeValue(JSONWriter jsonWriter, T object) {
        Calendar value = function.apply(object);

        if (value == null) {
            jsonWriter.writeNull();
            return;
        }

        long millis = value.getTimeInMillis();
        writeDate(jsonWriter, false, millis);
    }

    @Override
    public boolean write(JSONWriter jsonWriter, T o) {<FILL_FUNCTION_BODY>}

    @Override
    public Function getFunction() {
        return function;
    }
}

        Calendar value = function.apply(o);

        if (value == null) {
            long features = this.features | jsonWriter.getFeatures();
            if ((features & JSONWriter.Feature.WriteNulls.mask) != 0) {
                writeFieldName(jsonWriter);
                jsonWriter.writeNull();
                return true;
            } else {
                return false;
            }
        }

        writeDate(jsonWriter, value.getTimeInMillis());
        return true;
    
<methods>public java.time.format.DateTimeFormatter getFormatter() ,public ObjectWriter#RAW getObjectWriter(com.alibaba.fastjson2.JSONWriter, Class#RAW) ,public boolean isDateFormatISO8601() ,public boolean isDateFormatMillis() ,public void writeDate(com.alibaba.fastjson2.JSONWriter, long) <variables>protected ObjectWriter#RAW dateWriter,final non-sealed boolean formatISO8601,final non-sealed boolean formatMillis,final non-sealed boolean formatUnixTime,protected java.time.format.DateTimeFormatter formatter,final non-sealed boolean formatyyyyMMdd8,final non-sealed boolean formatyyyyMMddhhmmss14,final non-sealed boolean formatyyyyMMddhhmmss19