package cn.stylefeng.team.form.api.parser;

import cn.stylefeng.team.form.api.entity.FormItem;
import cn.stylefeng.team.form.api.parser.base.BaseFormFormat;

public class FormDateRangeFormat implements BaseFormFormat {

    @Override
    public Object formatProcess(FormItem formItem, Object originValue) {

        if (originValue instanceof String) {
            String stringValue = (String) originValue;
            stringValue = stringValue.substring(1, stringValue.length() - 1);
            stringValue = stringValue.replace(",", "-");
            return stringValue;
        }

        return null;
    }

}
