def to_weekdayname(date, abr = False): try: result = to_datetime(date).dt.weekday_name if abr: return result.str[:3] else: return result except: return lp_to_date_part(date=date, date_part='weekday_name', abr=abr)
def to_day(date): try: return to_datetime(date).dt.day except: return lp_to_date_part(date=date, date_part='day')
def to_year_monthname(date, sep='-', abr=False): try: return date.map(lambda x: lp_to_date_part(date=x, date_part='year_monthname', sep=sep, abr=abr)) except: return lp_to_date_part(date=date, date_part='year_monthname', sep=sep, abr=abr)
def to_weekday(date): try: return date.map(lambda x: lp_to_date_part(date=x, date_part='weekday')) except: return lp_to_date_part(date=date, date_part='weekday')
def to_monthname(date, abr = False): try: return date.map(lambda x: lp_to_date_part(date=x, date_part='month_name', abr=abr)) except: return lp_to_date_part(date=date, date_part='month_name', abr=abr)
def to_yearquarter(date, sep ='-'): try: return date.map(lambda x: lp_to_date_part(date=x, date_part='year_quarter', sep=sep)) except: return lp_to_date_part(date=date, date_part='yearquarter')
def to_yearmonth(date, sep ='-'): try: return date.map(lambda x: lp_to_date_part(date=x, date_part='year_month', sep=sep)) except: return lp_to_date_part(date=date, date_part='yearmonth', sep = sep)
def to_year(date): try: return to_datetime(date).dt.year except: return lp_to_date_part(date=date, date_part='year')
def to_quarter(date): try: return to_datetime(date).dt.quarter except: return lp_to_date_part(date=date, date_part='quarter')
def to_month(date): try: return to_datetime(date).dt.month except: return lp_to_date_part(date=date, date_part='month')