def METHOD_NAME(format_name):
    f = get_format(format_name)
    if not isinstance(f, str):
        f = f[0]
    return toJavascript_re.sub(
        lambda x: date_conversion_to_moment[x.group()],
        f
    )