(date_input)
Takes a gregorian date string or datetime and converts it to
    the equivalent ethiopian date

    :param date_input: A datetime or date string
    :returns: An ethiopian date string or ''
Takes a gregorian date string or datetime and converts it to
    the equivalent ethiopian date
Takes a gregorian date string or datetime and converts it to the equivalent ethiopian date
def get_gregorian_to_ethiopian(date_input):
    '''
    Takes a gregorian date string or datetime and converts it to
    the equivalent ethiopian date

    :param date_input: A datetime or date string
    :returns: An ethiopian date string or ''
    '''
    if not date_input:
        return ''

    try:
        if isinstance(date_input, date):
            date_input = date_input.strftime('%Y-%m-%d')
        year, month, day = split_date_string(date_input)
    except ValueError:
        return ''

    try:
        ethiopian_year, ethiopian_month, ethiopian_day = EthiopianDateConverter.to_ethiopian(year, month, day)
        return '{}-{:02d}-{:02d}'.format(ethiopian_year, ethiopian_month, ethiopian_day)
    except Exception:
        return ''
def get_gregorian_to_ethiopian ( date_input ) : if not date_input : return '' try : if isinstance ( date_input , date ) : date_input = date_input . strftime ( '%Y-%m-%d' ) year , month , day = split_date_string ( date_input ) except ValueError : return '' try : ethiopian_year , ethiopian_month , ethiopian_day = EthiopianDateConverter . to_ethiopian ( year , month , day ) return '{}-{:02d}-{:02d}' . format ( ethiopian_year , ethiopian_month , ethiopian_day ) except Exception : return ''